Compare commits

...

1428 Commits

Author SHA1 Message Date
Harald Welte
30afa983e1 Bump version: 1.2.0.1-2bb3 → 1.2.1
Tag patch release with gcc-10 compilation fixes

Change-Id: I37eb6c31b2463f43ed79a64d1f5cf7eb3b1bafb8
2020-07-26 11:52:24 +02:00
Harald Welte
2bb3d23f87 fix compilation with gcc-10
/usr/bin/ld: /home/laforge/projects/git/osmo-bts/tests/sysmobts/../../src/osmo-bts-sysmo/tch.c:584: undefined reference to `femtobts_tch_pl_names'
/usr/bin/ld: l1_transp_hw.o:/home/laforge/projects/git/osmo-bts/src/osmo-bts-sysmo/femtobts.h:108: multiple definition of `pdch_msu_size'; main.o:/home/laforge/projects/git/osmo-bts/src/osmo-bts-sysmo/femtobts.h:108: first defined here
/usr/bin/ld: l1_transp_hw.o:/home/laforge/projects/git/osmo-bts/src/osmo-bts-sysmo/femtobts.h:71: multiple definition of `femtobts_l1prim_type'; main.o:/home/laforge/projects/git/osmo-bts/src/osmo-bts-sysmo/femtobts.h:71: first defined here

see also: https://alioth-lists.debian.net/pipermail/debian-mobcom-maintainers/Week-of-Mon-20200413/000651.html

Change-Id: I4a9896153876fcda496365776883827746205f00
2020-07-26 11:48:22 +02:00
Pau Espin Pedrol
ee8f4b0a91 Bump version: 1.1.0.95-24e7-dirty → 1.2.0
Change-Id: Id132c615f7398402ac20d179e5917bea58ef3334
2020-01-03 17:18:44 +01:00
Philipp Maier
24e702b7d0 l1sap.c: ensure ms power control loop is running
When a bad SACCH frame is received the processing of the frame is ended
early and lchan_ms_pwr_ctrl() is not called. This means that the power
control loop does not get informed about a situation where the signal
level is very weak and increasing the ms power would make sense. In
order to ensure that the power control keeps working on lost SACCH
frames, lets call lchan_ms_pwr_ctrl() with the current RSSI and the
requested (BSC) power setting.

Related: OS#4281
Change-Id: I4fb85754b1a69376b02da7f4b175c6e8ec9cc35c
2020-01-03 13:03:49 +01:00
Philipp Maier
66c17cfc2d rsl: ensure measurement reports are sent
osmo-bts currently does not generate a measurement report in case the
SACCH of the related traffic channel is lost. This is a problem because
the moment when reception gets bad measurmenet reporting is crucial to
carry out handover decisions effectively.

The presence of a SACCH block controls the conclusion of the measurement
interval and the sending of the RSL measurement report. The latter one
not only requires a measurmenet indication, it also requires a fully
intact SACCH block.

Lets use the NOPE / IDLE indications from V1 of the TRXD protocol to
ensure a SACCH block is always reported up to l1sap.c. In cases where
the SACCH is bad, trigger the sending of the RSL measurement report
manually without attaching the measurmenet data from the MS (which we do
not have in this case)

Related: OS#2975
Depends: osmo-ttcn3-hacks Ib2f511991349ab15e02db9c5e45f0df3645835a4
Change-Id: Idfa8ef94e8cf131ff234dac8f93f337051663ae2
2020-01-03 12:56:00 +01:00
Vadim Yanitskiy
a2392f0f9e osmo-bts-trx/vty: ensure backwards compatibility with older config files
osmo-bts-trx used to have its own (low-level) MS Power Control loop,
but recently it has been ripped out. Since [1], the process fails to
start if the configuration file still contains 'ms-power-control dsp'.

Let's be more tolerant: override 'dsp' by 'osmo' and print a warning.

[1] I49706926b1e962b18791174627bc3cc0cd0cd9d5

Change-Id: I4facd21bca3d8cb80d21e83ea267bc013e474533
2019-12-31 17:03:38 +00:00
Pau Espin Pedrol
e1766f1b7d l1sap: is_fille_frame(): verify len of data compared
Change-Id: Id3d1725ff36091ed5c57927caad09a8baea6f52e
2019-12-23 18:27:47 +01:00
Pau Espin Pedrol
7544f5a45b power_control.c: Clarify loop algo vars and use correct ones during log
Rename some variables so that:
* Variables containing power control levels end up with "_lvl".
* Variables containing power levels end up with _dbm.
* Move old current_dbm var to be ms_dbm, to match its power control
level counterpart ms_power_lvl, and add current_dbm to match its
counterpart ns_power_ctrl.current.

Now that variables are more clear, it also becomes clear that old "diff >
0" condition, apart from difficult, was currently wrong, since in order
to print the raise/low verb we want to compare between old and new
values, not between received and new values. Let's fix that in this same
commit.

Change-Id: I4e279a6b93fbcc5da25bf8c9213310939fd493ce
2019-12-05 12:58:08 +01:00
Pau Espin Pedrol
99ba515985 power_control.c: Log maximum allowed MS Power Level
Change-Id: I983ff824ef6f54f1e800819d622158d5e2a51f04
2019-12-05 11:22:09 +00:00
Pau Espin Pedrol
397a43c38a rsl: Clarify when autnonoums MS Power Ctrl Loop is used
Simplify when the fixed field is set in rsl_rx_chan_activ.

Comment talks about enabling autonoumous control loop, but it is
actually describing it when disabling it, which is confusing.

Change-Id: Id6b444a33ab062f6dab11a0ce62d8aecaea87591
2019-12-05 11:22:09 +00:00
Harald Welte
e571fd60e6 rach_pass_filter(): Add information about channel type
When logging about filtering access bursts, let's indicate if this is
on a CCCH, PDCH or handover related.

Change-Id: I03f21f2b54cbe5aad36ac71a614d5df98867df80
2019-12-04 16:40:30 +01:00
Pau Espin Pedrol
80f9b84a64 rsl_rx_chan_act: Apply bitmask when parsing IE MS_POWER
Change-Id: I99c6a4d353f405582d5e4f9d12c01c25c7bb4dff
2019-12-03 18:34:40 +01:00
Vadim Yanitskiy
bd3eabc13e common/abis.c: use tall_bts_ctx as talloc-context for libosmo_abis_init()
This way it's much easier to introspect the library internal
talloc allocations from the VTY interface.

Change-Id: Ic8d9fc7ce3da8abf0ea73d2b20366133cd801c37
2019-12-02 23:21:27 +00:00
Vadim Yanitskiy
6bb700e9d2 common/abis.c: pass gsm_bts_trx to e1inp_sign_link_create()
Change-Id: I8a6242d3e02f9bd19d287ecad18e001a5991175f
2019-12-02 08:46:43 +00:00
Pau Espin Pedrol
e3a4530919 bts-trx: Drop low layer MS Power Control Loop algo
Let's drop it instead of having code duplication from common code in a
lower layer, and maintain only the one in l1sap for all BTS models.
As a result, osmo-bts-trx loses feature BTS_FEAT_MS_PWR_CTRL_DSP and
will only be able to use "ms-power-control osmo" in VTY, which will be
enabled by default (meaning: change of behavior, now MS Power Control is
enabled by default in osmo-bts-trx and can only by disabled by BSC).
Old bts-trx specific VTY command "(no) osmotrx ms-power-loop" is marked
as deprecated but still working for more usual case (1 TRX configured)
to avoid breaking backward compatibility.

TA low level loop is still kept in loops.c and will be moved to l1sap at
some point too.

Related: OS#1851
Change-Id: I0d8b0c981d9ead91d93999df6e45fb06e426aeb9
2019-11-30 18:50:04 +00:00
Pau Espin Pedrol
0d8cd8ce39 scheduler_trx.c: cast ptrdiff value to fix printf format
On an ARM toolchain:
scheduler_trx.c:294:3: warning: format '%ld' expects argument of type 'long int', but argument 10 has type 'int'

Let's cast it to long int to make sure correct size is applied in all
platforms.

Change-Id: I701b3dbc4e84db21cf02305d374b0df731e70313
2019-11-27 00:19:30 +00:00
Vadim Yanitskiy
3cb61d902c common/vty.c: fix: properly assert() the result of get_string_value()
Change-Id: I6ecd46371e601ad0fb629f9756b36c9c4758a958
Fixes: CID#205067, CID#205068
2019-11-26 17:14:39 +07:00
Vadim Yanitskiy
a070e863e2 pcuif_proto.h: extend RACH.ind with TRX and timeslot number fields
Since there can be multiple PDCH channels configured on different
timeslots, different TRXes, and BTSes, the PTCCH/U handling code
in OsmoPCU needs to know the exact origin of a given RACH.ind.

Otherwise, it is not known which subscriber originated a given
PTCCH/U indication, and hence it is impossible to send PTCCH/D
Timing Advance notification properly.

Fortunately, we can extend the RACH.ind message without even
bumping the protocol version, because every single PDU has a
fixed size defined by the largest message - INFO.ind. In case
if the actual message payload is smaller, the rest is filled
with a constant padding byte (0x00).

Older versions of OsmoPCU will consider the new fields as padding,
while the messages from older OsmoBTS versions will always have
both fields set to 0x00. Since C0/TS0 cannot be configured to
PDCH, this can be easily detected on the other end.

Change-Id: Iff38934a108b6b1cd298669834263a7d5296c3f6
Related: OS#4102, OS#1545
2019-11-22 17:38:07 +00:00
Pau Espin Pedrol
1d9f6efccb power_control.c: Limit speed of announced MS Power Level value changes
It's not a good idea to request big changes in MS Power based on
sporadic bad signal received, let's instead change announced MS power
levels more smoothly to avoid possible big signal strength fluctations,
similar to what is already done in osmo-bts-trx specific loop (loops.c).

Related: OS#1851
Change-Id: Iecc4ec7e21471ec853ad2d5659af4052aba5444c
2019-11-20 20:27:04 +01:00
Pau Espin Pedrol
522fc939e0 power_control.c: Don't use announced MS Power level as input for loop calculations
Use instead the received MS Power currently in use by the MS matching
the measured signal. This way there's no need to wait for the MS to
reach the announced MS power level or add checks in case the MS doesn't
support that specific power level. Furthermore, more fine grained
announced power level value can be obtained faster due to more input
iterations not being dropped while waiting.

osmo-bts-trx specific algo was not following this approach and using
announced MS power instead because it's wowrking at a lower level and
henche was not using the transmitted MS Power level value by the MS as
input for the calculation.

The "if (diff < 2 && diff > -2))" condition is dropped since equal
signal strength may still result in a different MS power level announced
(the one currently used by the MS during tx of last SACCH block).

Related: OS#1851
Change-Id: I4494dc27a295a3dca1d3331d4ff712d486643e13
2019-11-20 19:35:08 +01:00
Vadim Yanitskiy
595eb576fc osmo-bts-trx/trx_if.c: fix: NOPE.ind also contains C/I field
Change-Id: I201b72d2a6f5307ede252d5d707f1ebadafe6a4b
2019-11-20 13:43:37 +00:00
Philipp Maier
5c5ad3cb4a scheduler_trx.c: avoid division by zero when calculating BER
There is theoretical risk that when calculating the BER that a division
by zero occurrs. Lets add a check to avoid n_errors / n_bits_total when
n_bits_total is zero.

Change-Id: I1c0731b9a60be4b8c0c84b85b4403168120ceacd
Fixes: CID#205696
2019-11-20 13:35:02 +00:00
Oliver Smith
ae5e1d7110 osmo-bts-virtual.cfg: ms-power-control dsp -> osmo
Fix error while starting osmo-bts-virtual with the example config:
"This BTS model has no DSP/HW MS Power Control support"

Fixes: c693067b7e ("Introduce BTS feature BTS_FEAT_MS_PWR_CTRL_DSP")
Change-Id: I4f9a06e85d58294719a24197eb1c42a69fbd03d6
2019-11-19 18:28:32 +00:00
Vadim Yanitskiy
19857fbdaa osmo-bts-trx/trx_if.c: also print both RSSI and ToA256 for NOPE.ind
Change-Id: I36586ac33757705df16e14cfdd92becb96c8cf70
2019-11-19 13:54:40 +07:00
Vadim Yanitskiy
8a98255fb5 osmo-bts-trx/trx_if.c: fix: always initialize bi->burst_len for NOPE.ind
A NOPE.ind indicates absence of an Uplink burst, thus it does not
carry a burst. Let's init the burst length to avoid uninitialized
memory access in the scheduler code.

Change-Id: I77f686bf7df385215892e71733a28ff0d90d7222
Fixes: CID#205857
2019-11-19 13:54:36 +07:00
Vadim Yanitskiy
b37b3263a9 osmo-bts-trx: general handling of NOPE / IDLE indications
Each logical channel can now optionally have an additional handler,
that will be called when a NOPE / IDLE indication is received from
the transceiver. The aim of that handler is to keep the logical
channel state updated in case if one or more Uplink bursts are lost.

Change-Id: I71c552f44c25e56e9779d8b8ef5d4de9f8475637
Related: OS#3428
2019-11-19 01:01:45 +00:00
Pau Espin Pedrol
c693067b7e Introduce BTS feature BTS_FEAT_MS_PWR_CTRL_DSP
It indicates whether BTS model supports managing an MS Power Control
Loop over HW/DSP instead of using the software based osmocom algorithm
present in osmo-bts.
osmo-bts-trx own loop implementation is considered to be a "DSP/HW" one
since it acts on lower layers and interferes with osmocom algorithm
since it controls the same end variable "lchan->ms_power_ctrl.current",
this way we make sure both aren't enabled at the same time.
Old behavior in kept: if common upper-layer algo is not enabled
explicitly in VTY (ms-power-control osmo) and bts-trx specific lower
layer algo is neither enabled (osmotrx ms-power-loop <xyz>), then no
power control is done at all.

Related: OS#1851
Change-Id: I49706926b1e962b18791174627bc3cc0cd0cd9d5
2019-11-14 20:02:45 +01:00
Pau Espin Pedrol
d0a2caa021 power_control.c: Fix ms pwr ctrl skipped if MS doesn't support announced MS Power Level
Related: OS#1851
Change-Id: I1a9c00fe4eb3fa1eaa7997a9ec20716ddfe180a7
2019-11-14 20:02:45 +01:00
Pau Espin Pedrol
38c12e9df9 power_control.c: Log rx current and target signal levels
Change-Id: I31ce7930a1daa20a2ff81f31a37df94298c877d6
2019-11-14 20:02:45 +01:00
Pau Espin Pedrol
2149b0ff47 power_control.c: Apply latests improvements from loops.c
Several improvements have been made lately to MS Power Control loop from
osmo-bts-trx in loops.c. Let's port these to the common algorithm.

Related: OS#1851
Change-Id: I579967cc8bb69dc76a315c6c9d3a351f5961d92f
2019-11-14 20:01:58 +01:00
Pau Espin Pedrol
f0e66d90f8 bts-trx: loops.c: Avoid always clamping MS power to MS power class 1
The affirmation written there is not true, since actually it depends on
the band. For instance, for DCS1800 the maximum MS power is provided by
class 3. Let ms_pwr_ctl_lvl() take care of campling instead.

Change-Id: I744e7c315b818a1e7d3dd2579cd483c693d89b73
2019-11-14 16:36:00 +01:00
Pau Espin Pedrol
e717aec2f7 Move and rename gsm_lchan.ms_power field
Make it clear that it contains the maximum MS power level (TS 05.05) and
not the one to be used. The one aimed at is in ms_power_ctrl.current.
Since it's used in related code, move it inside the ms_power_ctrl struct
too.

Related: OS#1851
Change-Id: Ib264ec7dac87355cef6415461ed74bd8e9c8ca52
2019-11-14 16:36:00 +01:00
Pau Espin Pedrol
869091011c rsl: Remove unneeded duplicate reset on some lchan fields
Both ms_power and ms_power_ctrl are reset to 0 again further below.

Change-Id: Ia2a5da068d440232361d57bd5ac33eddebf05ebe
2019-11-14 16:36:00 +01:00
Pau Espin Pedrol
18bfa91a26 Change gsm_lchan field fixed to bool
Change-Id: I715ef151b67a21e325c574585a257e71b4b0ce2a
2019-11-14 16:36:00 +01:00
Pau Espin Pedrol
e5e1226301 Change gsm_bts_trx field to bool and rename it
Thies field is used to store and retrieve whether MS power needs to be
calculated and updated by osmo-bts software or autonomously by lower
layers. Previous name was not clear
and may have been understood as indicating whether MS Power Control loop
is done or not in general, and the responsible for that is located under
lchan's ms_power_ctrl.fixed.

Related: OS#1851
Change-Id: Ic690ab69866a7377f1597e24aa7b0214831c1cbe
2019-11-14 16:36:00 +01:00
Pau Espin Pedrol
d8d459c7e2 cosmetic: Fix trailing whitespace
Change-Id: I7b9a091226e3c7dd60b3921ab0d53688f42d1a4d
2019-11-14 16:36:00 +01:00
Pau Espin Pedrol
d93669289b rsl: Fix logged value in rx MS Power Control
The interesting value in this case is the incoming new ms max power.

Change-Id: Ib6fcb21b1b4bdbc8b749a1b8543d97331699ef3b
2019-11-12 17:46:38 +01:00
Pau Espin Pedrol
80f2bc4855 bts-trx: Implement MS Power control loop calculations using dBm instead of ctl levels
Some bands, such as DCS1800, contain power levels such as 29, 30 and 31 not following same
unified sequence other power levels follow regarding conversion to dBm
values.
This makes extremly complex and prone to error comparing different power
levels. Let's instead use dBm values to calculate and crop desired new
value, and then convert it back to TS 05.05 ms power control level
value.

With this commit the control loop should be able to manage correctly the MS power
levels explained above.

Related: OS#4244
Change-Id: I0160637c5ffa606ee3081ad30be8e6f2a42b725b
2019-11-12 14:19:08 +01:00
Pau Espin Pedrol
000b13ef52 rsl: Assign recv pwr to lchan's max ms power
Otherwise older ms_power value will be kept and used as a maximum.

From TS 08.58 sec 4.8 "MS power control":
"""
If power control is supported by BTS and it is to be used,
this is indicated by optional parameters in the MS POWER CONTROL
message (or the CHANNEL ACTIVATION message). Based on the
measurements performed on the uplink, TRX then attempts to keep
the power control parameters within the limits set by the
MS POWER CONTROL message (or by the CHANNEL ACTIVATION message).
"""

Change-Id: I0583eef477c33279ee5bfcda80141f365413a276
2019-11-12 14:17:24 +01:00
Philipp Maier
a9d88af594 scheduler_trx: initalize n_errors, n_bursts_bits, n_bits_total
Make sure the variables n_errors, n_bursts_bits, n_bits_total are always
initalized. For example in rx_tchh_fn() the value for n_errors is
defined in a switch statement, where the default lets n_errors
uninitalized, which is in that particular case a theoretical problem,
however, lets make sure that the variables n_errors, n_bursts_bits and
n_bits_total are always initalized with 0

Related: CID#205452
Related: CID#205451
Change-Id: If28ea11cc111c7d73ca47b25e65ce399e5baa4c1
2019-10-31 13:08:57 +01:00
Philipp Maier
132987daf4 scheduler_trx: use gsm0502_fn_remap() to calculate frame number
When sched_compose_tch_ind, sched_compose_ph_data_ind or l1if_process_meas_res
is called from rx_tchf_fn or rx_tchh_fn the frame number of the beginning of
the block is required. At the moment this frame number is calculated
wrongly using strange formulas. Lets use gsm0502_fn_remap() to calculate
the beginning of the block properly

Change-Id: I37601ddd85e4287dd9e41ad4a8cb7d314de1a83d
Depends: libosmocore I3d71c66f8c401f5afbad9b1c86c24580dab9e0ce
Related: OS#3803
2019-10-29 10:16:56 +00:00
Pau Espin Pedrol
3533c3f6ad cosmetic: l1sap.c: Fix typo
Change-Id: I9fee7be915546cfd11810c74d511beb8ec10d044
2019-10-28 18:28:33 +00:00
Pau Espin Pedrol
725b3158e2 power_control.c: Take into account RSL CHAN ACT ms power level limits
This is similar commit to Ifda92155bd9c277ac150a327a7ab63c854087788,
which previously fixed same issue for osmo-bts-trx specific power
control loop code.

TS 48.058 sec 4.8 MS power control:
"""
TRX then attempts to keep the power control parameters within the limits
set by the MS POWER CONTROL message (or by the CHANNEL ACTIVATION message)
by changing the MS Power Level field of the L1 header sent to MS in each
SACCH block.
"""

Should fix TTCN3 BTS_Tests.TC_rsl_ms_pwr_dyn_max for non-bts-trx BTS
models.

Related: OS#1622
Change-Id: I376b52d7bee44132993a69cf532bd418171d0ca2
2019-10-28 16:59:42 +01:00
Pau Espin Pedrol
5a60287e44 loops.h: Fix missing include for struct l1sched_trx
Change-Id: I67b63367e46bd43807f61e8f7e63924b8c2427e4
2019-10-28 11:05:47 +01:00
Pau Espin Pedrol
1e9d4feba5 bts-trx: loops.c: Take into account RSL CHAN ACT ms power level limits
TS 48.058 sec 4.8 MS power control:
"""
TRX then attempts to keep the power control parameters within the limits
set by the MS POWER CONTROL message (or by the CHANNEL ACTIVATION message)
by changing the MS Power Level field of the L1 header sent to MS in each
SACCH block.
"""

Fixes TTCN3 BTS_Tests.TC_rsl_ms_pwr_dyn_max

Change-Id: Ifda92155bd9c277ac150a327a7ab63c854087788
2019-10-28 11:05:29 +01:00
Pau Espin Pedrol
a456f2bd15 cosmetic: bts-trx: document variable power level
Change-Id: Ia4bc291c8213dd6cfe3b13a99b3108532b6907b1
2019-10-28 10:51:49 +01:00
Vadim Yanitskiy
be1651bb51 osmo-bts-trx/scheduler: fix: print the last frame number in rx_data_fn()
All other Uplink burst handlers print frame number of the last
(currently received) burst. Let's make rx_data_fn() consistent.

Change-Id: Ie5762a132326be3ef4e4e38cc126f05d51098a20
2019-10-21 11:21:55 +00:00
Oliver Smith
e4abc63e42 vty.c: avoid coverity BAD_SHIFT issues
Make it obvious for compilers and for coverity, that the sapi value used
to shift a bit for the sapi_mask is always <= 31. The sapi value is an
index of the value string l1sap_common_sapi_names, which has 24 entries.

Fixes: CID#205067, CID#205068
Change-Id: Id8be0ab67479b1f76a4f624bd3a5242e4fe59f4b
2019-10-21 11:09:08 +02:00
Oliver Smith
583f2b86c9 vty.c: don't ignore get_string_value() errors
Change uint8_t sapi to int, so we can properly assert on errors from
get_string_value().

Fixes: CID#205066, CID#205069
Change-Id: I4d30afacfab93051868ae8f462cee9ad3dbc7fd0
2019-10-21 11:08:50 +02:00
Martin Hauke
fc5f20a713 Rename variable: CALIB_SUCESS -> CALIB_SUCCESS
Correct the name of this variable.

Change-Id: I75cb6404d772b79933d1d9d694abf8eff1fad020
2019-10-17 08:05:35 +00:00
Martin Hauke
b378fccef1 Fix common misspellings and typos
Change-Id: I403b9029f57fec3fdec2c1e2cbeac0f6eab53f24
2019-10-17 08:05:35 +00:00
Oliver Smith
b58fb35754 vty: add "logging filter l1-sapi"
Add VTY commands to filter by L1 SAPI. Allow to filter by multiple SAPIs
by running the filter command multiple times:

OsmoBTS> logging filter l1-sapi agch
OsmoBTS> logging filter l1-sapi pch

Related: OS#2356
Change-Id: I32d86d3d34757135b4cce59919c2fc2b67f0a889
2019-10-17 08:04:27 +00:00
Pau Espin Pedrol
8ff35d3c91 bts-trx: Time out if no clock ind recvd after RSP POWERON
Before this patch, if due to whatever reason the TRX started fine (RSP
POWERON 0) and sockets were created but no CLOCK IND was ever received
by the BTS, it wouldn't notice since the timerfd timeouts
(bts_shutdown("no clock")) are only checked after the first CLOCK IND is
sent by the TRX.
As a result, the BTS would be kept on forever saying everything is fine
but it would be sending no DL burst at all to the TRX (tested with a
modfied osmo-trx dropping clock indication).
With this patch, new APIs are added to indicate the scheduler_trx code
the timeframes where clock ind are expected (between RSP POWERON 0 and
RSP POWEROFF 0); if TRX sends clock indications out of that timeframe,
BTs lower layers will drop them (controlled by "powered" bool).
Hence, the scheduler_trx can now place a timeout (reusing same timerfd
because its new use is exclusive in time with its other previous use)
when it is told that CLOCK IND should start appearing, and if none
arrives in considerable time, then the BTS can be shut down to notify
the rest of the network.

Related: OS#4215
Change-Id: Iba5dbe867aff10e70ec73dbf1f7aeeecb15c0a4d
2019-10-16 11:13:21 +00:00
Oliver Smith
5fee4d1ff5 log: set L1 SAPI log context
Add a new common L1 SAPI enum, to unify all the BTS specific SAPIs.
Translate to this enum, and set the context for uplink messages in
each BTS specific implementation.

Set the context for downlink messages in the common l1sap code, by
converting the osmo_phsap_prim back to the SAPI value (mostly looking at
chan_nr). The new functions for doing this conversion,
get_common_sapi_by_trx_prim() and get_common_sapi_ph_data(), are based
on the existing to_gsmtap() and gsmtap_ph_data() functions.

Note that we can't set the uplink SAPI context in the common code,
because then we can't set it as early as possible. In this patch, the
SAPI context is set for the PHYs where the SAPI is readily available.
With additional conversion from the RSL channel, the SAPI context could
be set for osmo-bts-trx in a follow up patch.

Related: OS#2356
Depends: (libosmocore) I814cb3328d99faca9220adb5a80ffb934f219d7d
Change-Id: I6b7bb2e1d61502b61214f854a4ec5cbb7267545b
2019-10-11 10:46:02 +00:00
Vadim Yanitskiy
a4c54b531c README.md: update osmo-bts-trx specific limitations
The ticket has been closed, BER and C/I measurements are now being
sent to OsmoPCU (see Ia58043bd2381a4d34d604522e02899ae64ee0d26).

Change-Id: I1909a70b82421802f32c1bc4f69a2e4210db5b2d
2019-10-10 01:50:00 +07:00
Vadim Yanitskiy
df51be6329 L1SAP: there can be no DATA.ind primitives on PTCCH/U, reject them
Change-Id: Ib846a9b8e619c7da56b5f0a54d16f629913af80d
2019-10-09 16:45:48 +00:00
Vadim Yanitskiy
d73832bc35 L1SAP: use GSMTAP_CHANNEL_PDTCH for PDTCH blocks by default
We don't know whether a data block on PDCH belongs to PDTCH or PACCH
without parsing it, because the latter one is being allocated on
demand. Let's use GSMTAP_CHANNEL_PDTCH by default, rather than
GSMTAP_CHANNEL_PACCH.

Change-Id: I7639215ef936a8ac05ca417a91f4e12755f318d4
2019-10-09 16:45:48 +00:00
Vadim Yanitskiy
2cbdeba5cf L1SAP: fix gsmtap_pdch(): there can be no DATA.ind on PTCCH/U
Change-Id: Id69010ffa8c697e8c01bbb21509253c330f95343
2019-10-09 16:45:48 +00:00
Vadim Yanitskiy
43a8ed2b55 L1SAP: use the actual ARFCN for outgoing PCUIF messages
Change-Id: I07b3aac97603d85fb6cf077d3a342b12b0643171
2019-10-09 16:45:48 +00:00
Pau Espin Pedrol
d8284eec63 bts-trx: Log TRXC and TRXD socket recv()/send() failures
Related: OS#4215
Change-Id: Ic3e41d82b43459495d45873d612a3bd349ac174a
2019-10-09 11:57:37 +00:00
Vadim Yanitskiy
eb43c947c1 L1SAP: properly handle 11-bit encoded RACH.ind in gsmtap_ph_rach()
Change-Id: Id263c2b716fd282d37d705a1c5f430ce7c0edaf0
2019-10-09 03:18:30 +07:00
Vadim Yanitskiy
29e47ffc20 L1SAP: refactor handling of Access Bursts on PDCH
First of all, we also need to apply the same filtering to Access
Bursts on PDCH as for the normal ones on RACH, i.e. filter them
by ToA (Timing of Arrival) and BER (Bit Error Rate).

Secondly, we shall not interpret Access Bursts on PDTCH/U as
handover related ones. Instead, let's print a warning and
ignore them since they are not (yet) supported by OsmoBTS.

Finally, in gsmtap_pdch() we need to set a proper channel type
for Access Bursts received on PDCH (PDTCH/U or PTCCH/U).

Change-Id: I461fde9f4543c45c42b591cd3fd0ff3d98673cec
2019-10-09 03:13:31 +07:00
Vadim Yanitskiy
d7103f9172 L1SAP: do not pass unused parameter to l1sap_handover_rach()
Change-Id: I7f2d909f1bde09cbec106240df290381b3418e46
2019-10-09 03:01:58 +07:00
Vadim Yanitskiy
91fc2b9e30 L1SAP: clarify debug messages in rach_pass_filter()
RACH stands for Random Access CHannel, while in rach_pass_filter()
we're dealing with Access Bursts, that may be received on other
logical channels too (e.g. PTCCH, PDTCH or any other).

Change-Id: I1e5ca9930ab491a6916c972865154d54530cbf51
2019-10-09 03:01:43 +07:00
Vadim Yanitskiy
e83c1196b8 L1SAP: also consider RSL_CHAN_OSMO_CBCH8 as CBCH
Currently we don't distinguish between CBCH on BCCH+SDCCH/4 and
CBCH on SDCCH/8, but in libosmogsm we have two independent
(non-standard) RSL channel number values for them. Maybe some day
we will, so let's extend the definition of L1SAP_IS_CHAN_CBCH.

Change-Id: I2f6d501a29edaf89dfb17d5d64f930cdb1943630
2019-10-09 03:01:35 +07:00
Vadim Yanitskiy
1c6a56fb97 L1SAP: use RSL_CHAN_* definitions from libosmogsm
Change-Id: I2708b5d5bb6b92f90766ac752bafd28cff2549b0
2019-10-09 03:01:19 +07:00
Oliver Smith
dc4d36d7bb gitignore: add oc2g generated files
Change-Id: I3e7af6d290988099535bab63bbc53a901d16b55f
2019-10-07 09:33:17 +00:00
Pau Espin Pedrol
b6be055e6b bts-trx: Drop unused func check_transceiver_availability()
After getting rid of transceiver_available, this function is not used
anymore by any code, since its per-trx counterpart
l1if_provision_transceiver_trx() is the one used by other
code.

Change-Id: If5a988eb14658a78dd46234dccc052dc12fb872a
2019-10-05 20:50:13 +00:00
Pau Espin Pedrol
ca574b19d3 bts-trx: Get rid of messy transceiver_available state handler
This variable meaning has been changing its exact meaning over time
until finally not being really clear which kind of state it holds.
Initially it seemed to be used to identfy whether CLOCK IND were being
received. However, over time both osmo-bts and osmo-trx have evolved and
were fixed so that clock indications are only sent by osmo-trx after
POWERON command is sent. As a result, this state can be checked simply by
looking at the "powered" phy_link variable, which is only set to true
once the TRX has confirmed the POWERON command, and hence it is sending
CLOCK IND.
On the other hand, at some point in time "available" started to be set to 1
in bts_model_phy_link_open(), which means available is nowadays almost
always 1 from startup until the end (only dropped during bts_shutdown(),
when we are already exiting the process anyway).
As a result, !available condition in scheduler_trx.c:trx_fn_timer_cb can
almost never happen, because available is set to true already. Only
possibility would be if an old process of osmo-trx (not set up by this
BTS process) is still sending CLOCK INDs, but in that case we for sure
don't want to configure the BTS based on that, but ignore them until
this BTS process has again configured the TRX. So that whole check can
be dropped. We are better checking for "powered" state, which is far
more accurate, and we better do that in trx_if.c before calling
trx_fn_timer_cb().

Other uses of "transceiver_available" being used can be changed to use
plink->state!= PHY_LINK_SHUTDOWN, since available was already being set
to 1 at the same time the plink->state was being set to
PHY_LINK_CONNECTING.

As a result of this state handling re-arrangement, OS#4215 is fixed
since trx_if_powered() is used instead of previous state condition to
check whether data frames should be sent.

Related: OS#4215
Change-Id: I35f4697bd33dbe8a4c76c9500b82c16589c701d4
2019-10-05 20:50:13 +00:00
Pau Espin Pedrol
9e1f0e1a13 bts-trx: Don't reset transceiver_available in scheduler_trx.c
It can be dropped since bts_shutdown() ends up calling immediatelly
bts_model_trx_close() which in turn calls bts_model_trx_close() which
sets enabled = false and calls l1if_provision_transceiver_trx() to
power off the TRX.

Related: OS#4215
Change-Id: If8b3d2379d7ae102e1c338f4558ac1352de761cc
2019-10-05 20:50:13 +00:00
Pau Espin Pedrol
96cb0c54a9 bts-trx: Rework code handling poweron state
Use of variables in each code is confusing and mixing configuration with
POWERON/POWEROFF state (which is at least per phy inst and not per TRX,
since those commands are only expected on the 1st phy inst).

* field "poweron" becomes "enabled", and is used as an indicator for
actions to take during TRX provisioning (hether to power it on and
configure it or to power it off).
* poweron/poweroff state becomes "powered", and it is shared by all trx
in same phy_link, and is updated only after confirmation by TRX.
* poweron_set becomes poweronoff_set (because it's used by both POWERON
and POWEROFF), and becomes shared by all trx in same phy_link, since
those CMDs are usually sent by first phy instance of the link (the first
trx).

Related: OS#4215
Change-Id: Icd0b482f1454236432e1952220bbec9d178b8607
2019-10-05 20:50:13 +00:00
Pau Espin Pedrol
4b72ee924c bts-trx: trx_set_bts(): Avoid double loop by checking current trx
check_transceiver_availability() is a loop over every trx, same to what
trx_set_bts() does, so let's call the per-trx version directly.

Change-Id: I8843c1438c6af700631aba7b7e72aae0bdb7ec3a
2019-10-05 20:50:13 +00:00
Pau Espin Pedrol
520954cd93 bts-trx: vty: Print phy link state in cmd 'show transceiver'
Change-Id: I8e49f8edad9f9c68d110dbb7faeea5143aa91022
2019-10-05 20:50:13 +00:00
Pau Espin Pedrol
accbf5bc73 bts-trx: Allocate struct osmo_trx_clock_state as part of bts-trx private data
Related: OS#4215
Change-Id: I9b7ffb51423ada74b8be347c57eade08f307f88f
2019-10-05 20:50:13 +00:00
Pau Espin Pedrol
972c243146 struct gsm_bts: Add model_priv pointer handing bts_model specific data
Currently there's bts-virtual specific fields in gsm_bts which is not used
by other models and are always allocated.
An alternative would be having a union with different structs inside,
one per model, but since we already have the bts_model abstraction, in this
case it makes more sense to use that abstraction instead of filling code
with preprocessor ifdefs to guard against non-defined types, etc.

Existing model specific data is moved there.

This new infra will be user further in forthcoming commits.

Related: OS#4215
Change-Id: Ib17a752cdbaa7d5eb8c5dfa0b197f80a4f38b38e
2019-10-05 20:50:13 +00:00
Vadim Yanitskiy
41c7b05283 common/l1sap: increase ToA precision for packet Access Bursts
QTA is a Timing Advance value in units of 1/4 of a symbol. Let's
use ToA256 (1/256 of a symbol) field of L1SAP RACH.ind as a base
for QTA calculation in order to achieve better precision.

Change-Id: I6e6fa7985c430a9bdbd12af2a8b2a5a66f11a41c
2019-10-04 15:53:53 +00:00
Vadim Yanitskiy
0772cd0460 osmo-bts-trx/scheduler: also detect TSC for Access Bursts on PDCH
If a logical channel, on which an Access Burst has been received,
is not either of RACH, PDTCH or PTCCH, then this is a handover
Access Burst, which is always encoded as 8-bit and shall contain
the generic training sequence (TS0).

Access Bursts on a PDCH time-slot are not related to handover.

Change-Id: If7d6135d6c4d7f9bd71d9fab6f8adc3f8cfd10ea
2019-10-04 15:53:53 +00:00
Vadim Yanitskiy
df5b813c0f scheduler: fix handling of PTCCH/U and PTCCH/D logical channels
According to 3GPP TS 45.010, section 5.6.2, for packet-switched
channels the BTS shall monitor the delay of the Access Bursts
sent by the MS on PTCCH and respond with timing advance values
for all MS performing the procedure on that PDCH.

According to 3GPP TS 45.002, section 3.3.4.2, PTCCH (Packet Timing
advance control channel) is a packet dedicated channel, that is
used for continuous Timing Advance control (mentioned above).

There are two sub-types of that logical channel:

  - PTCCH/U (Uplink): used to transmit random Access Bursts
    to allow estimation of the Timing Advance for one MS in
    packet transfer mode.

  - PTCCH/D (Downlink): used by the network to transmit
    Timing Advance updates for several MS.

As per 3GPP TS 45.003, section 5.2, the coding scheme used for
PTCCH/U is the same as for PRACH as specified in subclause 5.3,
while the coding scheme used for PTCCH/D is the same as for
CS-1 as specified in subclause 5.1.1.

The way we used to handle both PTCCH/U and PTCCH/D is absolutely
wrong - they have nothing to do with xCCH coding. Instead, we
need to use tx_pdtch_fn() for Downlink and rx_rach_fn() for Uplink.

In l1sap_ph_rach_ind() we need to check if an Access Burst was
received on PTCCH/U and forward it to OsmoPCU with proper SAPI
value (PCU_IF_SAPI_PTCCH). To be able to specify a SAPI, a new
parameter is introduced to pcu_tx_rach_ind().

Change-Id: I232e5f514fbad2c51daaa59ff516004aba97c8a3
Related: OS#4102
2019-10-04 15:53:53 +00:00
Pau Espin Pedrol
76837bddb7 l1sap: Log conn dropped due to radio link counter timeout
Change-Id: I78c5ff00be8d2c870ed0277294a8e499ba8a8d95
2019-10-02 19:03:41 +02:00
Pau Espin Pedrol
16da58d0c0 scheduler: Use OSMO_ASSERT instead of abort
Change-Id: I594842b08cdb97a473273ba7097a05502f5751b8
2019-10-02 19:01:07 +02:00
Pau Espin Pedrol
ccf9498865 scheduler.c: Move some message log level to DEBUG
Otherwise using "logging level set-all info" makes it impossible to see
anything in VTY due to tons of those two lines appearing.

Change-Id: I9c7500c1e56db0c4dcb474f93c882a9c7c004d55
2019-10-02 17:52:24 +02:00
Pau Espin Pedrol
35d4291a5e bts.h: Remove non-existent function definitions
Change-Id: I4d06e1cdea5970cbb493f29980b1c04e01c0e8a4
2019-09-27 14:57:05 +02:00
Pau Espin Pedrol
c91997b2cc bts-trx: vty: Use API to get poweron state
Change-Id: I8b78e1ad34f19d8fe348b9c975742fc0f7112da2
2019-09-27 13:38:51 +02:00
Pau Espin Pedrol
474eeed78d doc: bts-models.adoc: Fix typos in rts-advance section
Change-Id: I37ba104ec0538f8eb9345ff880660aefbdaa44ca
2019-09-19 10:07:32 +00:00
Pau Espin Pedrol
a1f2b6931b bts-trx: Change super verbose IDLE ind not-supported line to DEBUG
It's impossible to see other logging otherwise.

Change-Id: I64ee83b734ecff593ff2a1cf97b192db93228e22
2019-09-19 10:07:32 +00:00
Vadim Yanitskiy
b86e9260e8 osmo-bts-trx/scheduler: fix: check rc of osmo_ecu_frame_out()
Change-Id: I32d244f5ddef46c8b8719f5ec27b7456514d407a
Fixes: CID#204005 (CID#204007), CID#204006 (CID#204004)
2019-09-12 22:59:31 +02:00
Pau Espin Pedrol
3061e1d14a bts-trx: Log case where no SETFORMAT is sent
If VTY cmd "osmotrx trxd-max-version 0" is used, max version 0 is used
(default starting one) and hence no need to send SETFORMAT (this is
useful in order to avoid sending SETFORMAT to old TRX implementations
not supporting the command). In this case, let's inform the user that
indeed osmo-bts won't send SETFORMAT because version 0 is assumed.

Change-Id: I7136ea6745c2275278bc400676b58fb4b10da966
2019-09-10 14:48:19 +00:00
Harald Welte
ec228cc08c osmo-bts-trx: migrate to new generic ECU abstraction
libosmocodec has recently introduced a generic ECU abstraction layer
which supports (pluggable) Error Concealment Units for not only the
FR codec, but potentially any other codec, too.

Change-Id: I001005aae6de76d4e045b8dc572239f057bb150d
Depends: libosmocore I4d33c9c7c2d4c7462ff38a49c178b65accae1915
2019-09-10 12:26:21 +00:00
Vadim Yanitskiy
e6a72c2b80 osmo-bts-trx/scheduler: add FIXME note about FACCH/H and BFI
Change-Id: Ie006cd46cb574d272fbe3b38595a3087617c79d1
2019-09-07 23:09:09 +00:00
Vadim Yanitskiy
454b034521 osmo-bts-trx/scheduler: fix tx_tch_common(): do not send AMR BFI twice
We call _sched_compose_tch_ind() after the switch statement, so
there is no need to send it from case 'GSM48_CMODE_SPEECH_AMR'.

Change-Id: I0488082494120157ac438d7763b52e3998f0eac7
2019-09-07 23:05:22 +00:00
Harald Welte
9d5acaad5c osmo-bts-trx/scheduler: prevent uninitialized memory access
When sending an AMR BFI, we need to call osmo_amr_rtp_enc() with
AMR_BAD as the last parameter. This function returns the length
of encoded payload, which needs to be at least 2 octets long.

If osmo_amr_rtp_enc() returns a length value lower than 2 octets
(what should not happen in general), we should neither call
memset() on it, nor call _sched_compose_tch_ind().

Change-Id: I70ce98c5697b9ce6fac7ab57a5d70f3201db29d9
Fixes: CID#178648, CID#178637, CID#178651
2019-09-07 23:05:22 +00:00
Vadim Yanitskiy
af2a8a6c81 common/rsl.c: fix possible NULL-pointer dereference
Change-Id: I11a35a8f500fafa7b3c93d2f2244cc4d42f09f1b
Fixes: CID#203810
2019-09-07 23:05:22 +00:00
Harald Welte
faf861b881 doc: Update Abis manual RSL section with ETWS related infomration
Change-Id: I969153a204c167783ba394c9a911ff4484ded759
2019-09-07 11:31:23 +02:00
Harald Welte
2588b2abf6 pcu_interface: Forward ETWS Primary Notification to PCU
All MS/UE must be notified of ETWS Primary Notifiations.

Depending on their state, the notification goes different paths:
* CS dedicated mode: BSC sends it as L3 message over LAPDm / DCCH
* CS/PS idle mode: BTS sends paging messages on PCH
* PS TBF active: PCU send Packet Application Info

This enables the last of the three methods by passing any
ETWS Primary Notifications received over RSL via the PCU socket into
the PCU.

Change-Id: Ic0b3f38b400a0ca7e4089061ceb6548b0695faa6
Related: OS#4047, OS#4048
2019-09-06 11:57:37 +02:00
Harald Welte
f53fde91a3 ETWS Primary Notification via P1 Rest Octets
The ETWS (Earthquake and Tsunami Warning System) uses a so-called
ETWS Primary Notification which is sent
* to phones in dedicated mode (via DCCH from the BSC)
* to phones in idle mode (via P1 Rest Octets on PCH/CCCH)

This patch implements the second part of the functionality, i.e.
transmitting the related ETWS Primary Notification via PCH.  As
3GPP doesn't specify how this is communicated over Abis, we use
a new, vendor-specific RSL message type.

Closes: OS#4047
Depends: libosmocore I89c24a81ada6627694a9632e87485a61cbd3e680
Depends: libosmocore I36fc2ffc22728887d1cb8768c7fcd9739a8ec0fc

Change-Id: I18c60cdb86b9c19e09f5ec06d66e9b91608880e6
2019-09-05 14:30:17 +02:00
Oliver Smith
cb57028d52 pcu_sock: fix endian-swapped CellID
Convert the cell identity to LE when sending it to the PCU via unix
socket, just like we do it with the location area code.

In the Osmocom stack, the CellID is configured in OsmoBSC, sent as BE
via RSL to OsmoBTS, then with a socket to OsmoPCU (where OsmoPCU expects
it to be LE in a LE system). OsmoBTS was always sending the CellID as
BE to OsmoPCU. In March 2018, a regression in OsmoPCU [1] caused an
endianness swap in the CellID on LE systems, resulting by chance in the
correct, LE encoded, CellID as it should have been sent from OsmoBSC
(for LE systems). This regression was fixed in March 2019 [2].

I've verified this fix with a TTCN3 test [3].

[1] I787fed84a7b613158a5618dd5cffafe4e4927234 (osmo-pcu)
[2] I2f6cc930c5dbf8dac386b24b0756df2efe8199e4 (osmo-pcu)
[3] I6516808f4b9e9a2301f9ccc1e55ded14e7334c33 (osmo-ttcn3-hacks)

Related: OS#3854
Change-Id: I68faf4558f0686fb2a3db24077dceaae05bf0262
2019-08-29 15:44:37 +02:00
Oliver Smith
fc917d91bf virtual: set link quality for GSMTAP_CHANNEL_RACH
Don't ignore all incoming RACH requests anymore:
000881/00/23/14/09 Ignoring RACH request: link quality (0) below the minimum (50)

Related: OS#3925
Fixes: b777c0f3ec ("Move Access Burst link quality handling to L1SAP")
Change-Id: Ifcd576fed84346688e711a26a05c6d350588e83d
2019-08-23 12:34:48 +02:00
Oliver Smith
258856b329 Cosmetic: virtual: l1sap.c: fix typos
Change-Id: Id24e75812bda17e99f17a37b367462533a5607f9
2019-08-23 11:58:19 +02:00
Pau Espin Pedrol
ca8aa07127 Bump version: 1.0.1 → 1.1.0
Change-Id: I708f6a63b51459d77368c48e115f64aaa6646bfd
2019-08-07 15:59:03 +02:00
Pau Espin Pedrol
f9e67f44d4 configure.ac: Require libosmocore 1.2.0
Some commits started using libosmocore APIs
osmo_gsm48_rest_octets_si3_encode() and lapdm_channel_init2(), which are
only available in latest libosmocore release 1.2.0. Let's update
configure.ac accordingly.

Fixes: 1e96e31c10
Fixes: 46d62b984a
Change-Id: If84c53d8192e8db98eb9439b898d83e94c5e5476
2019-08-07 15:51:29 +02:00
Pau Espin Pedrol
b4d8f5cf13 Remove undefined param passed to {logging,osmo_stats}_vty_add_cmds
Since March 15th 2017, libosmocore API logging_vty_add_cmds() had its
parameter removed (c65c5b4ea075ef6cef11fff9442ae0b15c1d6af7). However,
definition in C file doesn't contain "(void)", which means number of
parameters is undefined and thus compiler doesn't complain. Let's remove
parameters from all callers before enforcing "(void)" on it.
API osmo_stats_vty_add_cmds never had a param list but has seem problem
(no "void"), so some users decided to pass a parameter to it.

Change-Id: Ia4d1a7914308d1481fe31fe0986265ead339e61e
Related: OS#4138
2019-08-05 16:13:09 +02:00
Harald Welte
cb0cb897ad scheduler_trx: Handle negative return of gsm0503_tch_hr_decode()
If gsm0503_tch_hr_decode() returns a negative error, we shouldn't
set the marker bit or pass the negative value as length value into
osmo_hr_check_sid().

Change-Id: If49ca6926c576a2b17507b6a95b6f3ca17877d66
Closes: CID#187645
2019-08-02 07:30:58 +00:00
Harald Welte
e8e864b219 osmo-bts-trx: Don't attemtp to adjust MS power if fixed
If the BSC has instructed the BTS via RSL to not autonomously perform
MS power control, we are storing this in lchan->ms_power_ctrl.fixed.

However, osmo-bts-trx would simply ignore that flag in loops.c and
continue to compute new MS power values based on measurement results.

Change-Id: I628d1f4f1094c22248d372c11c2ecc504135b757
2019-07-31 12:10:39 +02:00
Harald Welte
89f06e6c54 osmo-bts-trx: Don't increment rssi_valid_count twice
In the ms_power_val() function, don't increment the number of
valid RSSI values counter twice.

Change-Id: I19d9d933a69f7ad6252cbe51751d5db41790c698
2019-07-31 12:10:12 +02:00
Pau Espin Pedrol
160b624da8 trx: Use LOGPPHI instead of LOGP in some more messages
This allows to clearly identify the phy instance owning those messages.

Change-Id: I90990e4dbcbb2fb4a3fcb24658bdf53e57030bcf
2019-07-24 19:28:56 +00:00
Daniel Willmann
291468694b manuals: Update vty documentation
This documentation only includes commands for osmo-bts-virtual

Change-Id: Icc0c96d173f31f2eb5fcb6385525a17f94ead852
Related: OS#1700
2019-07-24 19:27:43 +00:00
Pau Espin Pedrol
e6372cff1b bts-trx: Introduce VTY command osmotrx trxd-max-version
This command allows setting a maximum TRXD format version to negotiate
with TRX. osmo-bts-trx will hence end up using that version if supported
by TRX, or a lower one otherwise (or fail if TRX doesn't support any of
them).
Since now the maximum version can be 0, avoid going through SETFORMAT
negotiation in that case, since 0 is the default version. This way we
keep backward compatibility with TRX implementations that exit upon
receival of unknown commands (such as SC5 current one).

The VTY command is located in the "phy" node instead of the "phy
instance" node because instances of same phy are expected to use same
host with same implementation, so TRXD version to use should be the same
for both.

Related: OS#4006
Change-Id: I5eb1fdc002f9d7f4acf475356d8fc998dc8f6326
2019-07-23 17:21:40 +02:00
Vadim Yanitskiy
aa54224e56 osmo-bts-trx/scheduler: rx_data_fn(): provide actual C/I ratio to L1SAP
Change-Id: Iea0dad65e9bc511f99375fd3ee2eb44e47a6168f
2019-07-21 21:55:51 +07:00
Vadim Yanitskiy
4ff47ff39a osmo-bts-trx/scheduler: rx_rach_fn(): provide actual C/I ratio to L1SAP
Change-Id: I8d86dec7ebc039cbfd038c4342ff328b11281865
2019-07-21 21:55:51 +07:00
Vadim Yanitskiy
b777c0f3ec Move Access Burst link quality handling to L1SAP
Change-Id: I893ec9c6c2ebad71ea68b2dc5f9f5094dfc43b78
Depends: (libosmocore) Ie2a66ebd040b61d6daf49e04bf8a84d3d64764ee
2019-07-21 21:55:51 +07:00
Vadim Yanitskiy
9649a42d5a Clarify and refactor link quality (C/I) handling
The radio link quality is defined by C/I (Carrier-to-Interference
ratio), which is computed from the training sequence of each
received burst, by comparing the "ideal" training sequence with
the actual (received) one.

Link quality measurements are used by L1SAP to filter out "ghost"
Access Bursts, and by the link quality adaptation algorithms. One
can define minimum link quality values using the VTY interface.

On the VTY interface we expect integer C/I values in centiBels
(cB, 10e-2 B), while the internal structures are using float
values in deciBels (dB, 10e-1 B). Some PHYs (sysmo, octphy,
oc2g, and litecell15) expose C/I measurements in deciBels,
while on the L1SAP interface we finally send then in centiBels.

Let's avoid this confusion and stick to a single format, that
will be used by the internal logic of OsmoBTS - integer values
(int16_t) in centiBels. This will give us the range of:

  -32768  .. 32767  centiBels, or
  -3276.8 .. 3276.7 deciBels,

which is certainly sufficient.

Change-Id: If624d6fdc0270e6813af8700d95f1345903c8a01
2019-07-21 13:51:57 +00:00
Harald Welte
db6c786350 sysmo/l1_if.c: Annotate fall-through in switch statement
Change-Id: I72937e087288fe7681fafe4099e49849657924bd
Closes: CID#162019
2019-07-21 10:30:32 +00:00
Daniel Willmann
37ea11e072 manuals: Add counter documentation
Change-Id: I994ad6aae7f409e0f15ff1d388127e16243b378a
Related: OS#1700
2019-07-18 19:54:33 +02:00
Vadim Yanitskiy
33ed0f8876 common/rsl.c: fix: properly handle SI3 Rest Octets
It was noticed with old Sony Ericsson phones (like W595 and K510i)
that the service provided by Osmocom network becomes unreliable
from time to time. The RSSI indicator on those phones shows that
the signal is lost, so neither CS nor PS services are working.

As it then turned out, System Information 3 broadcasted on the
Um interface is different than the one received from the BSC.
In particular, the content of SI3 Rest Octets IE is different.

Among with the 'GPRS Indicator', which is actually expected to
indicate whether the PCU is connected or not, SI3 Rest Octets
on the Um interface contain both 'Optional Power Offset' and
'Scheduling if and where' IEs, which are not present in the
original messages from the BSC.

Moreover, as soon as the PCU is connected, 'GPRS Indicator' IE
contains different 'GPRS RA Colour' value, and informs the MS
that System Information 13 is sent on extended BCCH, which
is not even supported by OsmoBTS!

The culprit is in rsl_rx_bcch_info(), where we pass a pointer
to osmo_gsm48_rest_octets_si3_decode(). Instead of passing a
pointer to the beginning of SI3 buffer, we actually need to
shift it to the beginning of the SI3 Rest Octets IE.

This change makes my Sony Ericsson phones happy ;)

Change-Id: Ia962cf21903ba674057cf52746996dd3254bc1c6
2019-07-18 08:17:36 +00:00
Thorsten Alteholz
2131a7931e fix spelling stuff mentioned by lintian
Change-Id: I3d6cb6fc1b182d8520ba60e431ab9b74e71d5e3c
2019-07-17 10:58:57 +00:00
Vadim Yanitskiy
af6f39025f osmo-bts-trx/scheduler: rx_rach_fn(): enrich debug message
Change-Id: I1cb28a9d6c98993705b73937409276994f375dc0
2019-07-16 04:16:13 +00:00
Vadim Yanitskiy
1ea7fd0609 osmo-bts-trx/scheduler: rx_rach_fn(): clarify handover RACH handling
Change-Id: I3da39d48052af1759297f4ad75c220b3046c0691
2019-07-16 04:16:13 +00:00
Vadim Yanitskiy
dc48fd8810 osmo-bts-trx/scheduler: rx_rach_fn(): use optional TSC info from TRX
TSC (Training Sequence Code) is an optional parameter of the UL burst
indication. We need this information in order to decide whether an
Access Burst is 11-bit encoded or not (see OS#1854).

If this information is absent, we try to correlate the received synch.
sequence with the known ones (3GPP TS 05.02, section 5.2.7), and
fall-back to the default TS0 if it fails.

Since the new TRXD header version, the training sequence code is
indicated by the transceiver. Let's use it!

Change-Id: I1e654a2e49cb83c5f1e6249c0de688f99bc466b0
Related: OS#1854, OS#4006
2019-07-16 04:16:13 +00:00
Vadim Yanitskiy
54e104496a osmo-bts/scheduler: provide actual C/I values to OsmoPCU
C/I (Carrier-to-Interference ratio) is a value in cB (centiBels),
computed from the training sequence of each received burst,
by comparing the "ideal" training sequence with the actual one.

So far, there was no way to expose more measurements from OsmoTRX,
excluding both RSSI and ToA. Since the new version of TRXD header,
we can receive C/I indications and send the averaged (per 4 bursts)
values to OsmoPCU (as a part of PCUIF_DATA.ind).

Please note that we also need to attach C/I measurements
to the following L1SAP primitives:

  - PRIM_PH_RACH.ind,
  - PRIM_PH_DATA.ind,
  - PRIM_TCH.ind,

but this will be done in the follow up changes.

Change-Id: Ia58043bd2381a4d34d604522e02899ae64ee0d26
Fixes: OS#1855
2019-07-16 04:16:13 +00:00
Vadim Yanitskiy
01cc8c0d21 osmo-bts-trx/scheduler: pass trx_ul_burst_ind to lchan handlers
This change needs to be done in order avoid adding more and more
arguments to the UL logical channel handlers (such as rx_rach_fn).

Since we have different versions of the TRXD header, and may have
other burst-based PHYs in the future, some fields of an Uplink
burst indication have conditional presence.

Change-Id: Iae6b78bafa4b86d0c681684de47320d641d3f7c0
Related: OS#4006, OS#1855
2019-07-16 04:16:13 +00:00
Vadim Yanitskiy
55dbafc497 osmo-bts-trx/trx_if.c: encode actual TRXD header version
Both TRX2L1 (Uplink) and L12TRX (Downlink) messages should use
the same TRXD header format (and version) as was negotiated.

Change-Id: Idbc598ef7c1871ee8da830f3fbe0a5cc386f873d
Related: OS#4006
2019-07-16 04:16:13 +00:00
Vadim Yanitskiy
139b8caa79 osmo-bts-trx/trx_if.c: add TRXD header version negotiation
This change introduces a new command for TRXD header format
negotiation - SETFORMAT. If the transceiver does not support
the format negotiation, it would reject this command with
'RSP ERR 1'. If the requested version is not supported by
the transceiver, status code of the response message should
indicate a preferred (basically, the latest) version.

The format of SETFORMAT command is the following:

  L1 -> TRX: CMD SETFORMAT VER_REQ
  L1 <- TRX: RSP SETFORMAT VER_RSP VER_REQ

where:

  - VER_REQ is the requested version (suggested by the L1),
  - VER_RSP is either the applied version if matches VER_REQ,
    or a preferred version if VER_REQ is not supported.

If the transceiver indicates VER_RSP different than VER_REQ,
OsmoBTS is supposed to reinitiate the version negotiation
using the suggested VER_RSP. For example:

  L1 -> TRX: CMD SETFORMAT 2
  L1 <- TRX: RSP SETFORMAT 1 2

  L1 -> TRX: CMD SETFORMAT 1
  L1 <- TRX: RSP SETFORMAT 1 1

If no suitable VER_RSP is found, or the VER_REQ is incorrect,
the status code in the response would be -1.

As soon as VER_RSP matches VER_REQ in the response, the process
of negotiation is complete. Changing the header version is
supposed to be done before POWERON.

Change-Id: I8afe950bd1ec2afaf3347ff848ee46e69c4f5011
Related: OS#4006
2019-07-16 04:16:13 +00:00
Eric Wild
e059aa3db7 RSL: Fix fixed MS power control in RSL CHAN ACTIV
Dynamic MS power control should only be active if a power parameters IE
was supplied.

Change-Id: I0bbe171a287b10d71fc853cd721f66e4c84db8c5
2019-07-16 04:05:54 +00:00
Oliver Smith
04e980dd10 contrib/jenkins.sh: run "make maintainer-clean"
Related: OS#3047
Change-Id: I9d9b2412f005e4bda0ed35ba715cfb4dca1b04c1
2019-07-10 13:36:11 +02:00
Vadim Yanitskiy
7d1d294807 osmo-bts-trx/trx_if.c: properly describe TRXD messages in logs
Since we may have different versions of the TRXD header, some new
fields of an Uplink burst indication have conditional presence.
Therefore we need a smart function to print them conditionally.

Change-Id: I68729dc98a1840d2aa9e091153d176a103d5a228
Related: OS#4006
2019-07-04 13:37:33 +07:00
Vadim Yanitskiy
3f2283cd3c osmo-bts-trx/trx_if.c: drop RSSI / ToA debugging code
This kind of debugging can be done using trx_sniff.py tool from
the TRX Toolkit [1]. Probably, this code was needed during the
initial development and testing.

[1] https://git.osmocom.org/osmocom-bb/tree/src/target/trx_toolkit

Change-Id: I50e0e5feeba4c3028f55209dd8e41e09ed5f70b1
2019-07-04 01:37:53 +07:00
Vadim Yanitskiy
a99c41bac5 osmo-bts-trx/trx_if.c: introduce TRXD header version 0x01 support
The new version adds the following fields to the TRX2L1 message,
keeping the L12TRX message unchanged:

  +------+-----+-----+-----+--------------------+
  | RSSI | ToA | MTS | C/I | soft-bits (254..0) |
  +------+-----+-----+-----+--------------------+

  - MTS (1 octet)  - Modulation and Training Sequence info, and
  - C/I (2 octets) - Carrier-to-Interference ratio (big endian).

== Coding of MTS: Modulation and Training Sequence info

3GPP TS 45.002 version 15.1.0 defines several modulation types,
and a few sets of training sequences for each type. The most
common are GMSK and 8-PSK (which is used in EDGE).

  +-----------------+---------------------------------------+
  | 7 6 5 4 3 2 1 0 | bit numbers (value range)             |
  +-----------------+---------------------------------------+
  | . . . . . X X X | Training Sequence Code (0..7)         |
  +-----------------+---------------------------------------+
  | . X X X X . . . | Modulation, TS set number (see below) |
  +-----------------+---------------------------------------+
  | X . . . . . . . | IDLE / nope frame indication (0 or 1) |
  +-----------------+---------------------------------------+

The bit number 7 (MSB) is set to high when either nothing has been
detected, or during IDLE frames, so we can deliver noise levels,
and avoid clock gaps on the L1 side. Other bits are ignored,
and should be set to low (0) in this case.

== Coding of modulation and TS set number

GMSK has 4 sets of training sequences (see tables 5.2.3a-d),
while 8-PSK (see tables 5.2.3f-g) and the others have 2 sets.
Access and Synchronization bursts also have several synch.
sequences.

  +-----------------+---------------------------------------+
  | 7 6 5 4 3 2 1 0 | bit numbers (value range)             |
  +-----------------+---------------------------------------+
  | . 0 0 X X . . . | GMSK, 4 TS sets (0..3)                |
  +-----------------+---------------------------------------+
  | . 0 1 0 X . . . | 8-PSK, 2 TS sets (0..1)               |
  +-----------------+---------------------------------------+
  | . 0 1 1 X . . . | AQPSK, 2 TS sets (0..1)               |
  +-----------------+---------------------------------------+
  | . 1 0 0 X . . . | 16QAM, 2 TS sets (0..1)               |
  +-----------------+---------------------------------------+
  | . 1 0 1 X . . . | 32QAM, 2 TS sets (0..1)               |
  +-----------------+---------------------------------------+
  | . 1 1 1 X . . . | RESERVED (0)                          |
  +-----------------+---------------------------------------+

== C/I: Carrier-to-Interference ratio

The C/I value is computed from the training sequence of each burst,
where we can compare the "ideal" training sequence with the actual
training sequence, and then express that difference in centiBels.

== Limitations

  - The only supported modulation types are GMSK and 8-PSK.
    Messages with other modulation types will be rejected.

  - IDLE / NOPE indications are not (yet) handled.

  - The logical channel handlers do not (yet) handle optional
    fields, such as TSC and C/I. This will be implemented
    in the follow-up changes.

Change-Id: If61c71d20d590bf07bfd019afb33000a0b6135bd
Related: OS#4006
2019-07-04 01:28:50 +07:00
Vadim Yanitskiy
b06cd9f439 osmo-bts-trx/trx_if.c: introduce TRXD header version handling
It may be necessary to extend the message specific header with
more information. Since this is not a TLV-based protocol, we
need to include the header format version.

  +-----------------+---------------------------+
  | 7 6 5 4 3 2 1 0 | bit numbers (value range) |
  +-----------------+---------------------------+
  | X X X X . . . . | header version (0..15)    |
  +-----------------+---------------------------+
  | . . . . . X X X | TDMA TN (0..7)            |
  +-----------------+---------------------------+
  | . . . . X . . . | RESERVED (0)              |
  +-----------------+---------------------------+

Instead of prepending an additional byte, it was decided to use
4 MSB bits of the first octet, which used to be zero-initialized
due to the value range of TDMA TN (0..7). Therefore the current
header format has implicit version 0.

Otherwise Wireshark (or trx_sniff.py) would have to guess the
header version, or alternatively follow the control channel
looking for the version setting command.

This change introduces a new structure 'trx_ul_burst_ind', which
represents an Uplink burst and the corresponding meta info. The
purpose of this structure is to avoid overloading the existing
functions, such as trx_sched_ul_burst(), with more and more
arguments every time we bump the version.

On receipt of a TRXD message, trx_data_read_cb() now parses
the header version, and calls the corresponding dissector
functions, e.g. trx_data_handle_(hdr|burst)_v0().

Change-Id: I171c18229ca3e5cab70de0064a31e47c78602c0c
Related: OS#4006
2019-06-27 12:51:02 +07:00
Vadim Yanitskiy
d1e7d0dafa osmo-bts-trx/trx_if.c: rename and clarify TRX_MAX_BURST_LEN
This constant actually defines the maximum TRXD message length,
which includes the header and burst bits, not just burst.

Change-Id: I383125e1c4df039fc6b554833bc8736deacbe731
2019-06-27 05:50:17 +00:00
Vadim Yanitskiy
b5c23092c7 osmo-bts-trx/trx_if.c: use osmo_loadXXbe() for TDMA FN and ToA256
Change-Id: Iec0d86f9be7243578ddc1ab322fc313cb5ac5d0b
2019-06-27 05:50:17 +00:00
Pau Espin Pedrol
f2271d0888 bts: Bypass T200 DCCH values for CCCH
Otherwise t200_ms_dcch array values are left uninitialized with random
values, and passed later on to lapdm_channel_init2().

lapdm_channel_init2() will anyways fail during initial check on
get_n200_dcch() and return -EINVAL, so let's not print garbage or call a
function which will anyways simply return an error.

Catched due to some strange values seen in log (see D0 and D3):
osmo-bts/src/common/bts.c:421 (bts=0,trx=0,ts=0,ss=4) Setting T200 D0=1028672, D3=2, S0=520, S3=520 (all in ms)

Related: OS#4066
Change-Id: I3d7e1883811acf97aac97325739f2ff97fc2aa08
2019-06-25 15:56:09 +02:00
Eric Wild
5b9212d6c5 revert changes to T200
The timers are unfortunately completely broken, so let's go back to the
long default timeout values from 1ff0a2addd

See related issues OS#4066 and OS#4074



Change-Id: Ia44310245a348675dbbf3ffc3dc5b6d207fd62d3
2019-06-21 17:00:04 +00:00
Daniel Willmann
876edd5e35 manuals: Add script to regenerate counter/vty documentation
This will generate the VTY/counter documentation for osmo-bts-virtual so
it will be missing documentation for device-specific commands/counters.

Change-Id: Idebb099b69924d6212db119f7a2f2861d4150d7e
Related: OS#1700
2019-06-19 12:46:01 +02:00
Pau Espin Pedrol
5a3eb6470d gsm_data_shared.h: Remove unused loc_list from struct gsm_bts
Change-Id: I52880962dfb0399c613048aa7ddfd828d3c6c933
2019-06-13 17:42:05 +00:00
Harald Welte
46d62b984a lapdm: Use new libosmocore API to ensure per-channel-type N200 values
By using new libosmocore LAPDm API we can specify the GSM channel type
and hence enable the LAPDm code to use a per-channel-type specific N200
value.

At the same time, this new API also allows us to specify T200 values
when initializing the LAPDm channel, so we don't have to fiddle with
low-level lapdm data structures in what used to be oml_set_lchan_t200().

Change-Id: I0e814fbae13e0feddd148c47255dcc38cb718f48
Depends: libosmocore I90fdc4dd4720d4e02213197c894eb0a55a39158c
Closes: OS#4037
2019-06-13 15:38:01 +00:00
Harald Welte
1ff0a2addd Update T200 timer default values
The default values of 1s were *very* long, particularly for fast
channels such as FACCH.  Let's use much more aggressive values
that are more in-line with various recommendations that cold be
found online, such as
https://pcstelconext.wordpress.com/2011/05/02/2g-timer-explanations/
https://www.erlang.com/forum/erlang/thread.htx?thread=2844
https://www.erlang.com/forum/erlang/thread.htx?thread=7180
https://de.slideshare.net/BisiAdebambo/138078380-gsmtimers-59637131

Change-Id: Ic1268ae2d769b12da6cdd4ac8375e4bc033a9e3e
2019-06-13 15:38:01 +00:00
Harald Welte
8ea9ba6af8 [correctly] use the LAPDm T200 values received via OML
As per GSM TS 12.21, the LAPDm timers (T200) of the LAPDm instances
in the BTS are configured via OML from the BSC.  While OsmoBSC
is sending them and OsmoBTS is parsing them, OsmoBTS stopped to
make use of them from commit 3ca59512d2
(January 2016) onwards.

The cause for this has been documented and discovered in May 2017
in https://osmocom.org/issues/2294 and it is quite obvious:  LAPDm
timers are supposed to start when a given frame is actually transmitted
on the radio interface.  PH-RTS.ind and PH-DATA.req are suppsed to be
used over a synchronous interface in some deeply embedded processor.

With OsmoBTS however, we have an asynchronous L1/L2 interface between
a DSP (osmo-bts-{sysmo,lc15,oc2g,octphy}) or OsmoTRX (osmo-bts-trx)
and we receive PH-RTS.ind quite some time ahead.  So if we start T200
at that point, then it will start running way before it has been sent
or before the MS has had a chance to receive the message.

The "correct" way to handle this is to actually measure the difference
between frame numbers in PH-RTS.ind (uplink, advanced) and PH-DATA.ind
(downlink) or PH-TIME.ind, and then add that amount to the actual
timeout value.  This ensures that the timers will time-out the
user-specified amount of time after the actual transmit.

Change-Id: If8babda9e3e5e219908911ddd9c0756b5ea0bca4
Closes: OS#2294
Closes: OS#3906
2019-06-13 15:38:01 +00:00
Harald Welte
b24ef23570 l1sap: Compute statistics on FN advance in PH-RTS.ind
Let's keep some statistics about the min/max/average frame number
advance that we're observing above L1SAP when comparing the time in the
PH-RTS.ind and the frame number we observe in PH-DATA.ind of data
that was received on the uplink.

The statistics are currently only shown in the VTY, but this is a
precursor to using them to correctly advance the LAPDm timers in a
follow-up patch.

Change-Id: I8f739fdb808a614f080afbc4654641ec3df19eb2
Related: OS#2294
Related: OS#3906
2019-06-13 15:37:13 +00:00
Vadim Yanitskiy
01c539284e common/scheduler.c: refactor description of TRXC_* lchans
Let's avoid fancy alignment in the description of logical channels
for the benefits of having better readability, the ability to add
more comments and fields without making it look ugly.

Get rid of value-string array 'trx_chan_type_names', since each
logical channel has its name defined in 'trx_chan_desc'.

Get rid of field 'chan' of 'trx_lchan_desc' structure since it's
not used anywhere, and not actually needed because the position
of each lchan description is defined by its TRXC_* type.

Replace both 'pdch' and 'auto_active' fields with more generic
bitmask field called 'flags', and define the following flags:

  - TRX_CHAN_FLAG_AUTO_ACTIVE,
  - TRX_CHAN_FLAG_PDCH.

Use RSL channel mode #defines from libosmogsm instead of having
hard-coded numbers. This increases readability.

As a bonus, let's add a human readable description to each lchan
definition, so it can be printed in the VTY some day.

Change-Id: I9d5d49ec569f133d37b8164b22607d4700474315
Backported from: I2fc61e1cdca4690a34e2861b9ee3b7c64ea64843
		 I7ab4958801b3422973b67ff0452b90afa8a3f501
2019-06-08 10:09:42 +00:00
Vadim Yanitskiy
2dec9fff1c Use #define RSL_CHAN_RACH for RSL Channel Number of RACH
Change-Id: I7f54fccdae6799e5f4d956a101e11c2d6f998546
2019-06-05 21:06:10 +07:00
Pau Espin Pedrol
8576477de1 bts-trx: trx_if.c: Introduce logging macro LOGPPHI
This way we unify format. We take the chance to add related information
to some log messages which were not printing that information (and was
confusing when using more than one phy instance).

Change-Id: I5b17a01638ade9a6c41da73e550d5947fa92f568
2019-06-04 17:58:46 +02:00
Vadim Yanitskiy
a52c78dd3e common/bts.c: bts_supports_cm(): take care about GSM48_CMODE_SIGN
At the moment, bts_supports_cm() is only called on reception of
RSL Channel MODE MODIFY from the BSC. The idea is to check whether
the indicated RSL channel mode is supported by a BTS model.

RSL Channel MODE MODIFY message may indicate a channel in signalling
mode, i.e. GSM48_CMODE_SIGN, which has always been rejected so far.

Let's assume that signalling is always supported, as there is
no special BTS_FEAT_* definition to check that.

This change should make BTS_Tests.TC_rsl_modify_encr pass.

Change-Id: I8ea98a3eb9dc15a04f665596ee276883eb824b9a
2019-06-03 15:08:11 +00:00
Harald Welte
f6b6c48c8b trx: Update documentation for fn-advance and rts-advance
Change-Id: I83eff296bfb7acff9d8560b5346bd9791fe6e7d9
Related: OS#4036
2019-06-03 07:18:51 +00:00
Vadim Yanitskiy
aaca1217be common/rsl.c: RSL_IE_HANDO_REF is mandatory for handover CHAN ACT
According to 3GPP TS 48.058, section 8.4.1, the Handover Reference
element must be included if channel activation type is 'handover'.
Let's properly reject CHANnel ACTivation messages with missing
RSL_IE_HANDO_REF. Otherwise such requests are misinterpreted
as regular (non-handover) channel requests.

Found using TC_ho_rach() TTCN-3 test case.

Change-Id: I9c50e1dbeb54c5470560adcdfb2bdf5abbe47993
2019-06-01 19:23:42 +00:00
Vadim Yanitskiy
8ec940ce9a osmo-bts/scheduler.h: cosmetic: use bool for ho_rach_detect
Change-Id: Id357e4ed38cbdca2082322da12b93d556056e916
2019-06-01 23:10:02 +07:00
Vadim Yanitskiy
9d083ab236 osmo-bts-trx/l1_if.h: drop unused ho_rach_detect from trx_l1h
Change-Id: I90b6d7fb1bb7ba2f8b1f500043635b0ae5cb4495
2019-06-01 23:10:02 +07:00
Vadim Yanitskiy
e50903df9d osmo-bts-trx/trx_if.c: dropping Tx bursts is a noticeable event
Change-Id: Ia954b797a9bb90660b6548ec0ffb218a1dcff37a
2019-06-01 13:43:21 +07:00
Oliver Smith
e05279a296 debian: create -doc subpackage with pdf manuals
I have verified, that the resulting debian packages build in my own OBS
namespace (see the -doc packages):
https://download.opensuse.org/repositories/home:/osmith42/Debian_9.0/all/
https://build.opensuse.org/project/show/home:osmith42

Depends: Ib7251cca9116151e473798879375cd5eb48ff3ad (osmo-ci)
Related: OS#3899
Change-Id: I6d7a182d0a668693a5014aca0edc50ada9ac0d0f
2019-05-31 14:23:59 +00:00
Daniel Willmann
5abae93dad osmo-bts-lc15: Change LED behaviour to be the same as oc2g
It looks like the status LED on the sysmobts2100 never worked correctly
since lc15bts-mgr expects osmo-bts-lc15 to create and manage
/var/run/osmo-bts/state, but there is nothing to do so in osmo-bts.

This patch copies the functions from oc2g to manage the state file in
lc15.

Change-Id: Iad32a22fc72e2aba45e4f1b9ae585f6e0b8757ed
Related: SYS#4493
2019-05-29 17:35:57 +02:00
Daniel Willmann
34711de016 osmo-bts-oc2g: Fix status LED responsibilities
osmo-bts-oc2g no longer modifies the status LED and instead leaves that
to the bts manager. The service file now also creates a directory in
/var/run needed for osmo-bts to communicate with oc2gbts-mgr. This
status file is used by oc2gbts-mgr to figure out when the bts is
operational.

Related: SYS#4493
Change-Id: Ifae634c6c2ecec7d32298c0f266f91f3e81308f5
2019-05-29 17:35:57 +02:00
Harald Welte
1e96e31c10 clear GPRS indicator in SI3 while PCU is disconnected
osmo-bts cannot provide GPRS service while osmo-pcu is not connected.
The BSC has no knowledge of the PCU connection state. Prevent MSs
from trying to register for GPRS while the PCU is disconnected by
erasing the GPRS Indicator in SI3.

Change-Id: I1a6f5c636c0fe098ee31c280d4572a3f8122b44b
Depends: I690cf308311f910005a325d50f5d5d825678d2b2 (libosmocore.git)
Depends: I08e0ca9a8d13c7aa40b9d90f34f0e13adb87d4e0 (libosmocore.git)
Depends: I8b1ee2405f6338507e9dfb5f1f437c4c2db2e330 (libosmocore.git)
Related: OS#3075
2019-05-28 19:59:07 +02:00
Neels Hofmeyr
347fea69a0 lc15,sysmo,oc2g: fix dsp-trace-flag command
Remove the '~' from '|= flag', it is plain wrong.

This affects the correct parsing of DSP trace flags from the config
file only.  The bug is not present in the interactive VTY command
at runtime.

Change-Id: I915971f49642967c969f5dd475e8faa960ef3960
2019-05-28 19:55:48 +02:00
Harald Welte
9ef6fa0798 Fix passing of RR SUSPEND REQ from DCCH to PCU socket
The existing code ssumed that the RR SUSPEND REQ would be a
LAPDm/RSL unitdata request.  I couldn't find any spec reference
that would support this.  Rather, the message is sent via the normal
main dedicated channel, which is operated in ABM mode.

As the somewhat similar check for diverting measurement results
is in fact looking for UNITDATA, we have to untangle this slightly.

Change-Id: Ic75486f8edaefa9c07bd92515ba1832b1c482fa6
Related: OS#2249
Related: OS#4023
2019-05-27 15:47:15 +00:00
Vadim Yanitskiy
0cb2829f17 common/rsl.c: fix NULL-pointer dereference in rsl_rx_rll()
Change-Id: I07e39e69a42dd09841f5d03608ec0d0b2345139a
Fixes: CID#198663 Null pointer dereferences
2019-05-26 17:59:37 +00:00
Harald Welte
dfa3bb8a10 Add severity to OML FAILURE EVENT REPORT
Example: The fact that the PCU has connected with a given version is not
a *failure* in the first place, particularly not a MAJOR one.  Let's
allow callers of oml_tx_failure_event_rep() specify the serverity of the
event that they're reporting to the BSC.

Change-Id: I49af04212568892648e0e8704ba1cc6de8c8ae89
2019-05-25 10:24:13 +02:00
Harald Welte
b8265c63cc oml: Have one generic log message for all transmitted messages
Rather than open-coding "Tx foobar..." in various functions (and
forgetting it in half of them), let's add a generic message into
oml_mo_send_msg().

Change-Id: I5dd4b1749e68fb7fc74cb2e3a778d2418f46b770
2019-05-24 11:08:20 +02:00
Harald Welte
7f1b61df5f oml: Print more context from FOM Header or using MO
Some of our OML log lines were missing any context.  Try making more
sense by printing any context information about the given managed
object, TRX, ... as we have it.

Change-Id: I60d1660c6d574f206d7b8cc10082b413142365dd
2019-05-24 11:08:20 +02:00
Harald Welte
f2419bf8c3 l1sap: Fix calculation of expired RACH slots in case of missing frame numbers
In case of a Combined CCCH (with SDCCH/4), the number of RACH slots
depends on the frame number.  So in case of lost/skipped frame numbers,
we cannot simply compute the value for the current fn and then multiply
it by the number of frame numbers expired.  Rather, we have to 'replay'
all missed frame numbers and individually determine how many RACH
slots happened in that frame.

Related: OS#3750
Change-Id: If4f8d2ea55fc722c64c330cde09e833b67ee98fe
2019-05-24 11:08:20 +02:00
Harald Welte
03e3fae639 l1sap: Correctly count RACH slots in calc_exprd_rach_frames()
We used a bogus multiplication factor of four when computing the number
of expired RACH slots.  While there are four RACH slots per block (i.e.
4 times more RACH received than normal MAC blocks), that multiplier
doesn't apply here:  We are calling this function per *frame* and not
per *block*.  So the maximum number of RACH slots per *frame* is (in
most suual cases with a single CCCH) at maximum 1. Only some obscure
configurations with multiple CCCHs in a single cell would render higher
values.  In any case, *blocks* never even enter this equation.

This wrong multiplier resulted in rather weird RACH load reports to the
BSC.

Related: OS#3750
Change-Id: I6b14fd6e7819f9164fb4a09b432a9f419e3b6e5c
2019-05-24 11:06:42 +02:00
Harald Welte
095654d361 load_indication: Fix missing re-set of RACH parameters
While we re-set the PCH load counters after every report, we never
actually re-set the RACH load counters.  This meant that the
period/window for RACH load averaging would always grow, rather than
being reset every load indication period.

Related: OS#3750
Change-Id: Icd9150ba56d77d031c3cf496c5936c2de52b364c
2019-05-24 11:03:37 +02:00
Harald Welte
b1a9a77727 rsl: MS POWER COCNTROL isn't (only) about "forcing" power levels
...so let's have a more neutral error message

Change-Id: I1ffa336b18347c2fcedfeb398b255dc517245d7a
2019-05-24 11:03:37 +02:00
Harald Welte
839b0f264f rsl: Implement parsing of BS Power Control message
Change-Id: Id144a7e468f730e3cdaefa4cf2ad51c6106310a2
2019-05-24 11:03:37 +02:00
Harald Welte
bf5d8eed11 RSL: Fix logic about fixed/dynamic MS power control in MS POWER COMMAND
The spec is quite clear: If the MS Power Parameters IE is present, then
the BTS shall perform autonomous MS power control.  If it's absent,
then the MS power shall be fied.  Let's adjust our code accordingly.

Change-Id: Ie43a1fc9cc658677c8c945ae82d03b7bffbe52d5
Related: OS#1622
2019-05-24 00:02:35 +02:00
Harald Welte
29aee05f75 rsl.adoc: DELETE INDICATION is implemented since Feb '18
In the following commit, we introduced transmitting the
RSL DELETE INDICATION on AGCH overflow:

	commit 19da7fdea8
	Author: Harald Welte <laforge@gnumonks.org>
	Date:   Sat Feb 24 04:32:29 2018 +0100

So let's sync the manual with the code.

Change-Id: I988778bdb83271355dc11b1a30a59e1a5dba5fb2
Related: OS#2990
2019-05-24 00:02:34 +02:00
Harald Welte
b07e271994 Use LOGPLCHAN whenever possible
There's no point in open-coding what LOGPLCHAN was created to do:
Log some event while stating the name of the logical channel.

Change-Id: I6913ac8fb543811126b85a54118333155c03bc03
2019-05-24 00:02:34 +02:00
Harald Welte
482564b422 cbch: Improve verbosity and extend logging; Always indicate BASIC/EXTD CBCH
Change-Id: I6c8f9fc6215b616371e46c1f4ca4e44b8c7ac096
2019-05-23 19:16:11 +00:00
Harald Welte
590b23ce3c cbch: Add counters; queue length limits and CBCH LOAD reporting
This adds the final missing part to full CBCH support:
* keep a tab on the current queue length for basic + extended CBCH
* keep rate counters about the number of sent / transmitted SMSCB
* send CBCH LOAD information via RSL to the BSC

Change-Id: I7068c7937a60a900c40439115bb84dc3ee0d061f
2019-05-23 19:16:11 +00:00
Harald Welte
d7be09caf8 sysmo: Fix "nominal power" / BS power display in VTY
The function get_p_max_out_mdBm() returns a value in 1/1000th of dBm,
"milli-dBm", while trx->nominal_power is only whole dBm.  We were
missing the required divider of 1000 ever since Change-Id
Ieff75d5becaa80a2097b6e744c75c2d16259c9a4 was merged in February 2017.

The good news is that this really only affected the VTY output and
not any actual operational aspect of the system.

Change-Id: If92d0b15c48dafc63776b82c7ff5f3c2b3505f68
Closes: SYS#4570
2019-05-22 22:38:38 +02:00
Harald Welte
57f9a279e0 README.md: Mention LimeSDR as SDR device
Change-Id: I0ab5b5721861d7e29c66e849d9e0f4eec2e047e6
2019-05-21 20:34:52 +02:00
Harald Welte
519f588715 manual: SMSCB BROADCAST COMMAND has no limitations anymore
We meanwhile support the SMSCB Channel Indicator IE and hence
can send SMSCB on both BASIC as well as EXTENDED CBCH

Change-Id: I63cc9c8c4c8c80440a61a0687e1f0cb97cc723b7
2019-05-21 20:34:52 +02:00
Harald Welte
396dc59ae8 manual: We now support RSL CBCH LOAD INDICATION
Change-Id: Iad7c364863b4de34bcded9f3c1e737ae0ed8e407
2019-05-21 20:34:52 +02:00
Harald Welte
0f9595f462 cbch: Keep SMSCB queue length counter
This avoids having to iterate the list to count the number of elements.

Change-Id: I72c47affeb87c9b898bc2290dc7ed113945f1805
2019-05-21 02:42:00 +02:00
Harald Welte
067824841f cbch: Support Extended CBCH
The logic for Extended CBCH are the same as for the Basic CBCH, we just
need to
* duplicate our related state
* parse the optional RSL_IE_SMSCB_CHAN_INDICATOR IE
* start to send data on the Extended CBCH (TB=4..7)

Change-Id: If2c6dc7da1e2185ab75fc957f8d305ad8db22429
Closes: OS#3535
2019-05-21 00:31:11 +02:00
Harald Welte
89bfea63c9 cbch: Fix memory leak and send error message on invalid SMSCB command
Change-Id: I411d1fb3693a2f7cf7bba3d38b1aaf276a4137ba
Related: OS#4011
2019-05-21 00:31:11 +02:00
Harald Welte
5567d71d39 cbch: Implement support for DEFAULT message
The BSC can not only send us each to-be-sent message separately, but
it can also configure a DEFAULT message, which is then to be sent
instead of the NULL message.  Let's add support for this

Change-Id: I65a79215b54155d128c26d2ca11ff9ff3ed2cdba
Closes: OS#4013
2019-05-21 00:31:11 +02:00
Harald Welte
0b682f4997 cbch: Log every RSL SMSCB COMMAND with type and number of blocks
Change-Id: I20efe0aa5a67f011d6b6bead57236366c2f45ecf
2019-05-21 00:31:11 +02:00
Harald Welte
dde2f1d5cf cbch: Refactor get_smscb_block() / remove smscb_msg.next_seg
There's no need to keep around a pointer to the next segment
in a SMSCB message.  The way how the multiframe structure is
laid out (and how the tb number works), we can use the result
of a modulo-division on the frame number to determine which
of the segments/blocks inside a SMSCB message (page) we have
to transmit.

This also acts as a simplification in preparation of support
for the SMSCB DEFAULT type.

Change-Id: I48faa19fec4a0852e6112ca2faa98960c678d4c5
Related: OS#4013
2019-05-21 00:31:11 +02:00
Harald Welte
8294368b23 cbch: Implement handling of "Schedule" message
The first block of "schedule" messages must be advertised with
a special sequence number coding, see Table 1 of 3GPP TS 44.012.

Change-Id: I473edf698eba7ff5008f2fd1ec1776f0aa013858
Closes: OS#4012
2019-05-21 00:31:11 +02:00
Harald Welte
7240062b75 RSL: Fix off-by-one error when parsing SACCH INFO IE in RSL CHAN ACT
This off-by-one error in length verification caused all SACCH INFO IE
to be deemed invalid and hence any RSL CHAN ACT with that IE to be
rejected.

Change-Id: I6436caf5c2caefbf7c089d66e37d8d1babe1c24e
Related: OS#3750
2019-05-21 00:31:11 +02:00
Harald Welte
1873a30a4a RSL: Reject RLL messages for lchans that are not active yet
The Radio Link Layer (RLL) messages only make sense when a given
logical channel is active.  If it isn't active, let's reject the
messages with an RSL ERROR REPORT with cause "Message sequence error",
wich according to spec means:

"A message with an existing message type which is not possible according
 to the specification and to the state of the BTS is erroneous."

Related: OS#3750
Change-Id: I68dbb622aeaee657471664cdc0b69c2ac316d77e
2019-05-21 00:31:07 +02:00
Harald Welte
bac9224b3b rsl: Include Channel Nr and Link ID in Error reports whenever possible
While the CHAN_NR and LINK_ID IEs in ERROR REPORRT are optional, we
still should include it whenever possible to help error analysis.

Related: OS#3750
Change-Id: I8155e0d37096bd7bf3563e4f7853171ca4b3aa58
2019-05-20 14:39:17 +02:00
Harald Welte
d96fd011d6 rsl: Send RSL Error Report in case of unknown/unsupported msg_type
Send an RSL Error Report in case of unknown/unsupported msg_type,
as describedi in section 7.3 of 3GPP TS 48.058.

Related: OS#3750
Change-Id: Ib2918007410e635b144a7535cec30b9f3378c755
2019-05-20 14:39:17 +02:00
Oliver Smith
2f251843f9 Revert "debian: create -doc subpackage with pdf manuals"
This reverts commit ad7b8bee71.

Unfortunately the osmo-gsm-manuals-dev package isn't working properly
yet, therefore osmo-bts fails to build on nightly OBS now. My apologies
for not testing enough in my own OBS namespace, before merging. I'll do
that in the future. I'm reverting the patch now, so osmo-bts isn't
missing from the nightly repository until I've fixed the
osmo-gsm-manuals package.

Change-Id: I89c2b92c8ae6331d6fff95a378fb58d82059af13
2019-05-20 13:51:51 +02:00
Oliver Smith
ad7b8bee71 debian: create -doc subpackage with pdf manuals
Related: OS#3899
Depends: I7edb5093e5b58eb3b0f7af2376476db4026db735 (osmo-gsm-manuals.git)
Depends: Ideeae4f7846fa5626fe2c1f5a77e07a3c6e626fe (osmo-ci.git)
Change-Id: I4c184c62804c0b805a0a2425a5bd0312e94e49ab
2019-05-20 10:28:45 +00:00
Vadim Yanitskiy
c6c2aa9ecd README.md: remove OS#1865 from 'Known limitations'
Neither the bug has been reproduced, nor the bug reporter
did respond to request for configuration files.

Change-Id: Ibc9db360be1380abaa9eef4bdf6e9a6d251670da
2019-05-10 07:09:07 +00:00
Alexander Huemer
a7ee918284 Remove 11-bit RACH support from 'Known Limitations'
Support for extended (11-bit) RACH has been implemented:

  - in libosmocoding: I85a34a82d5cd39a594ee89d91a2338226066ab5d,
  - and OsmoBTS: Ia28741603636406744e5e22ffff1fb7a9689955a.

We also have a TTCN-3 test case called TC_pcu_ext_rach_content,
see I8fe156aeac9de3dc1e71a4950821d4942ba9a253.

Change-Id: I091f4fbd52c29c7d56ca392b8a1b872609829d81
2019-05-10 07:09:07 +00:00
Vadim Yanitskiy
5b1c1b2184 osmo-bts-sysmo: fix: indicate BTS_FEAT_CBCH support on OML
It seems osmo-bts-sysmo does support CBCH (Cell Broadcast), but
for some reason it doesn't report BTS_FEAT_CBCH to the BSC.

Change-Id: I42dd3f84c44c210d9255e17153372bf252f897a1
2019-05-10 03:48:04 +07:00
Vadim Yanitskiy
5f9e42a891 osmo-bts-trx: distinguish 11-bit Access Bursts by synch. sequence
Thanks to both TC_rach_content and TC_rach_count TTCN-3 test cases,
it was discovered that there are possible collisions when trying
to decode a regular 8-bit Access Burst as an 11-bit one. This is
exactly what we are doing in rx_rach_fn():

  - calling gsm0503_rach_ext_decode_ber() first,
  - if it failed, falling-back to gsm0503_rach_decode_ber().

With default BSIC=63, the following 8-bit RA values are being
misinterpreted as 11-bit Access Bursts:

  Successfully decoded 8-bit (0x00) RACH as 11-bit (0x0000): bsic=0x3f
  Successfully decoded 8-bit (0xbe) RACH as 11-bit (0x0388): bsic=0x3f
  Successfully decoded 8-bit (0xcf) RACH as 11-bit (0x0036): bsic=0x3f

According to 3GPP TS 05.02, section 5.2.7, there are two alternative
synch. (training) sequences for Access Bursts: TS1 & TS2. By default,
TS0 synch. sequence is used, unless explicitly stated otherwise
(see 3GPP TS 04.60).

According to 3GPP TS 04.60, section 11.2.5a, the EGPRS capability
can be indicated by the MS using one of the alternative training
sequences (i.e. TS1 or TS2) and the 11-bit RACH coding scheme.

In other words, knowing the synch. sequence of a received Access
Burst would allow to decide whether it's extended (11-bit)
or a regular (8-bit) one. As a result, we would avoid possible
collisions and save some CPU power.

Unfortunately, due to the limitations of the current TRXD protocol,
there is no easy way to expose such information from the transceiver.
A proper solution would be to extend the TRX protocol, but for now,
let's do the synch. sequence detection in rx_rach_fn(). As soon as
the TRX protocol is extended with info about the synch. sequence,
this code would serve for the backwards-compatibility.

This change makes the both TC_rach_content and TC_rach_count happy,
as well as the new TC_pcu_ext_rach_content() test case aimed to
verify extended (11-bit) Access Burst decoding.

Related (TTCN-3) I8fe156aeac9de3dc1e71a4950821d4942ba9a253
Change-Id: Ibb6d27c6589965c8b59a6d2598a7c43fd860f284
Related: OS#1854
2019-05-09 16:22:20 +00:00
Harald Welte
9354474b0f handle NULL return from rate_ctr_group_alloc()
Change-Id: I2170e400e47369e9171af4c7361aa2177fea1174
Related: OS#3701
2019-05-08 14:03:36 +02:00
Vadim Yanitskiy
27ee75e4c0 common/oml.c: fix: properly encode NM_ATT_SW_CONFIG
According to 3GPP TS 52.021, sections 9.4.61-62, 'SW Configuration'
shall contain a list of 'SW Descriptions' related to the MO. In
other words, all 'NM_ATT_SW_DESCR' blobs shall be encapsulated
into a single NM_ATT_SW_CONFIG attribute.

For some reason, they were not encapsulated properly, so
OsmoBSC were unable to parse the 'SW Descriptions'.

However, unlike OsmoBSC the old OpenBSC does not expect this
encapsulation, thus after this change it will be unable to
parse the 'SW Descriptions'.

Change-Id: Id26104719891944f3e2151df362bd45bb057a9c5
Related: OS#3938
2019-05-07 00:40:14 +07:00
Vadim Yanitskiy
038a1fa047 common/oml.c: refactor Get Attribute Response message generation
Instead of allocating two transitional buffers (one static,
another dynamic), we can use the existing message buffer.

Both handle_attrs_bts() and handle_attrs_trx() can put (append)
the reported attributes, and push (prepend) non-reported ones
as per 3GPP TS 52.021, 9.4.64 "Get Attribute Response Info".

Change-Id: I349447a43bce360f59e0c6b435906c65167d158b
2019-05-07 00:30:09 +07:00
Vadim Yanitskiy
5efbd4e862 common/oml.c: fix broken debug print in down_mom()
Change-Id: Ideac59946d50c6e06052a9590e02cfcfbf23d003
2019-05-05 16:47:49 +03:00
Vadim Yanitskiy
40b1b4b20d common/oml.c: use proper format specifier for uint16_t
Change-Id: I8f372a689b3c1cc2cf925654b2db44a0f4ee7603
2019-05-05 16:46:20 +03:00
Vadim Yanitskiy
57e26c3e16 common/oml.c: introduce and use both LOGPFOH and DEBUGPFOH
Change-Id: I9e9d6ccb88c9c9d35b2ce5778fa2580382704089
2019-05-05 16:45:06 +03:00
Vadim Yanitskiy
ab5eff60e1 common/paging.c: fix unaligned pointer access
Passing a pointer to a packed structure to tmsi_mi_to_uint() may
result in unaligned pointer value. Found with clang-8.

Change-Id: Ief69854973a098e6da7c05f4417dc11988edd777
2019-04-24 15:57:06 +07:00
Vadim Yanitskiy
19bd4f818d common/rsl.c: fix unaligned pointers in rsl_add_rtp_stats()
Found using clang-8:

  rsl.c:1646:7: warning: taking address of packed member 'packets_sent'
		of class or structure 'ipa_stats' may result in an
		unaligned pointer value
  rsl.c:1646:28: warning: taking address of packed member 'octets_sent'
		 of class or structure 'ipa_stats' may result in an
		 unaligned pointer value
  rsl.c:1647:7: warning: taking address of packed member 'packets_recv'
		of class or structure 'ipa_stats' may result in an
		unaligned pointer value
  rsl.c:1647:28: warning: taking address of packed member 'octets_recv'
		 of class or structure 'ipa_stats' may result in an
		 unaligned pointer value
  rsl.c:1648:7: warning: taking address of packed member 'packets_lost'
		of class or structure 'ipa_stats' may result in an
		unaligned pointer value
  rsl.c:1648:28: warning: taking address of packed member 'arrival_jitter'
		 of class or structure 'ipa_stats' may result in an
		 unaligned pointer value

Change-Id: Ifba33cfd8edeccc99a21c7d076db7119c29d4f40
2019-04-24 14:34:10 +07:00
Vadim Yanitskiy
d16b69f29e common/rsl.c: fix size argument in memcmp() call
Found using clang-8:

  rsl.c:1607:93: warning: size argument in 'memcmp' call
                          is a comparison [-Wmemsize-comparison]
  rsl.c:1607:7: note: did you mean to compare the result of 'memcmp' instead?

It looks more logical to compare the result of memcmp() against
zero instead of passing 'sizeof(sysinfo_buf_t) != 0' as size.

Change-Id: Ia8b95b017dbbfeb058d479fbaaf4861930569bb5
2019-04-23 15:17:01 +07:00
Vadim Yanitskiy
43033e6923 common/l1sap.c: fix: add missing new line to a debug message
Change-Id: I7c0dab255289a5847d1a0af009e8962e4410e5ca
2019-04-21 13:50:21 +00:00
Vadim Yanitskiy
d16322f5ed common/oml.c: fix total length calculation in cleanup_attr_msg()
Both callers of cleanup_attr_msg(), i.e. handle_attrs_trx() and
handle_attrs_bts(), always pass out_offset >= 1, so the length
of the unsupported attributes counter is already accounted.

Otherwise, both callers would copy an additional garbage byte
from uninitialized memory. Discovered using Valgrind:

DOML DEBUG oml.c:539 OC=BTS(01) INST=(ff,ff,ff) Rx GET ATTR
DOML INFO oml.c:265 BTS Tx Get Attribute Response
==25467== Syscall param socketcall.sendto(msg) points to uninitialised byte(s)
==25467==    at 0x623E0BD: send (send.c:27)
==25467==    by 0x5685846: __handle_ts1_write (ipaccess.c:358)
==25467==    by 0x5683F8B: ipa_client_write (ipa.c:79)
==25467==    by 0x5683F8B: ipa_client_fd_cb (ipa.c:140)
==25467==    by 0x5F1DC23: osmo_fd_disp_fds (select.c:223)
==25467==    by 0x5F1DC23: osmo_select_main (select.c:263)
==25467==    by 0x42980B: bts_main (main.c:354)
==25467==    by 0x6160F44: (below main) (libc-start.c:287)
==25467==  Address 0x7d83895 is 23,669 bytes inside a block of size 102,528 alloc'd
==25467==    at 0x4C2AB80: malloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==25467==    by 0x589A6B4: talloc_pool (in /usr/lib/x86_64-linux-gnu/libtalloc.so.2.1.5)
==25467==    by 0x5F1E28B: msgb_talloc_ctx_init (msgb.c:316)
==25467==    by 0x4293D0: bts_main (main.c:234)
==25467==    by 0x6160F44: (below main) (libc-start.c:287)
==25467==  Uninitialised value was created by a stack allocation
==25467==    at 0x415FE5: oml_tx_attr_resp (oml.c:259)
==25467==    by 0x415FE5: oml_rx_get_attr (oml.c:561)
==25467==

Change-Id: Ic7c2c4e54e9f99b60aaf70604044933978be945c
Related: OS#3938
2019-04-19 20:22:29 +07:00
Vadim Yanitskiy
77b98d4a16 common/oml.c: use proper OML object for Get Attribute Response
It was noticed that the Get Attribute Response message always
indicates BTS(00,ff,ff) as the addressed OML entity, even if
e.g. Baseband Transceiver(00,00,ff) was requested by the BSC.

Despite neither OsmoBSC nor OpenBSC does complain about this,
such behaviour violates 3GPP TS 52.021. Let's fix this.

Change-Id: Icb1ee75d4bf680deb6365288d8c2053816a12217
Related: OS#3938
2019-04-19 20:22:26 +07:00
Vadim Yanitskiy
d1e9ded94d common/oml.c: use proper NACK reason in oml_tx_attr_resp()
Change-Id: I482caa0747f81da2979bfbdbd22bd6962af728cd
2019-04-19 20:20:47 +07:00
Vadim Yanitskiy
b873b91c5f common/oml.c: constify argument 'trx' of handle_attrs_trx()
Change-Id: Id476d492b3c1d0c728fca9eb0fb2254512bdef72
2019-04-19 20:20:47 +07:00
Philipp Maier
ac3924e093 pcu_sock: use %zu conversion specifier for printing sizeof() result
When using %lu and sizeof() for printing the compiler may throw a
warning. Lets prevent this by using %zu instead of %lu as conversion
specifier.

Change-Id: If5cb656537b1b73b9361a132801ab47ab7f8a709
2019-04-16 10:07:34 +02:00
Philipp Maier
73d174e35f oc2gbts_mgr: use osmo_init_logging2() instead of osmo_init_logging()
The function osmo_init_logging() is deprecated, lets use
osmo_init_logging2() as suggested.

Change-Id: Iebc80cd1f77f10a879d4536d788377f522dd853f
2019-04-15 11:57:35 +00:00
Vadim Yanitskiy
720971c6a0 common/pcu_sock.c: fix possible memleaks in pcu_sock_read()
Change-Id: I58352e5f2b5715361c7089d0e134a42975171022
2019-04-12 21:29:43 +07:00
Philipp Maier
620c74b7fe oc2gbts_mgr_calib: do not return NULL on integer function
The functions oc2gbts_par_get_uptime() and oc2gbts_par_set_uptime() try
to return with NULL, but both functions are declared as int. Lets return
-EINVAL instead.

Change-Id: I63b61be2940c59b221089d3d1501371b0116d89a
2019-04-08 11:23:39 +02:00
Philipp Maier
a89581b22d oc2gbts_mgr_calib: don't use fsync() on *FILE pointer
fsync() takes an integer file descriptor but we have a *FILE pointer
here. Lets use fileno() first to convert the integer file descriptor to
a FILE pointer.

Change-Id: I46ffd8c680ba0b445cbbd133d5ce92b79e3d8d87
2019-04-08 11:23:39 +02:00
Philipp Maier
668d20cc1d l1_if: add include for missing header file
the function bts_cbch_get() is used in l1_if.c. The function is
declared in cbch.h. Lets include this header file in order to be
complete.

Change-Id: I95d7e89eed969dd5b3ccff0eebcc6c568196a97d
2019-04-08 11:23:39 +02:00
Vadim Yanitskiy
45a8d4b2be common/oml.c: fix: properly push abis_nm_ipa_magic
In oml_send_msg() we optionally push the A-bis IPA magic string
("com.ipaccess") to a given message buffer as LV (Length Value),
including the terminating null byte ('\0').

There was a mix of both sizeof() and strlen() calls, and worse
luck, memcpy() has been used in a wrong way, skipping the '\0':

  memcpy(dest, src, strlen(src));

In general, this is not critical because the headroom of a given
message buffer would most likely be zero-initialized, so the '\0'
is already there. However, msgb_push() gives no such guarantee.

Let's use the libosmocore's TLV API (in particular, lv_put()),
and stick to sizeof(), so the null byte will always be included.

Change-Id: I0c7f8776d0caec40f9ed992db541f43b732e47ae
Closes: OS#3022
2019-04-01 07:18:32 +07:00
Harald Welte
41723e1508 Forward GPRS SUSPEND REQ from DCCH to PCU socket
As specified in 3GPP TS 03.60 Section 16.2.1 and 44.018 Section 3.4.15,
a Class B MS is sending a "RR GPRS SUSPEND REQ" via a DCCH to the BTS if
it wants to suspend GPRS services.  The BSS is now responsible to
somehow forward this to the SGSN.  As the Gs interface between BSC and
SGSN is both optional and doesn't have any provision to forward this
message, we have to send it over to the PCU so it can use regular BSSGP
signaling to inform the SGSN of the SUSPEND REQUEST.

This patch requires libosmocore Change-Id
I90113044460a6c511ced14f588876c4280d1cac7 for the related definition of
struct gsm48_gprs_susp_req.

Change-Id: I3c1af662c8f0d3d22da200638480f6ef05c3ed1f
Closes: OS#2249
2019-03-27 11:19:11 +00:00
Philipp Maier
945c09381d oml: use oml_tx_failure_event_rep() instead of signals to SS_FAIL
At some locations in the code a signal to SS_FAIL is dispatched in order
to trigger the sending of an OML failure event report in oml.c. This is
a bit overcomplicated for the task. Lets use oml_tx_failure_event_rep()
to send the failure event reports and lets remove the signal handler for
SS_FAIL.

Change-Id: Ie4fce1273a19cc14f37ff6fc7582b2945c7e7c47
Related: OS#3843
2019-03-27 11:10:57 +00:00
Philipp Maier
a5a03d6b35 oml: use oml_tx_failure_event_rep() instead of oml_fail_rep()
The function oml_tx_failure_event_rep() replaces oml_fail_rep(), so lets
use only oml_tx_failure_event_rep() and remove oml_fail_rep()

Change-Id: I83c4fa9ebd519299fd54b37b5d95d6d7c1da24f6
Related: OS#3843
2019-03-27 11:10:57 +00:00
Philipp Maier
891ba1568a main: remove wrong call to oml_fail_rep() on SIGUSR1/2 and SIGABRT
SIGUSR1/2 and SIGABRT should not trigger a failure event report on
OML since we only use it to get an intermediate talloc report. (In
case of SIGUSR1/2 without leaving the process.)

Change-Id: I99e637496afff2530425b89c6e9befc76db24906
2019-03-27 11:10:47 +00:00
Philipp Maier
c49df5d144 vty: add function gsmnet_from_vty() to vty.h
The function gsmnet_from_vty() is used in oc2gbts_vty.c, but it is not
declared in vty.h. Lets add the declaration to vty.h, so that
gsmnet_from_vty() can be used properly by other modules.

Change-Id: I8cf63c6fabdb1f2dc67ca8193704ce4d1d4882d9
2019-03-27 10:09:17 +00:00
Pau Espin Pedrol
749b878eb1 contrib: Remove deprecated screen script helpers
Nowadays only known users (OE images) use systemd and don't require this
kind of screen setup.
In any case, this kind of file belongs to scpeific setup and are not
needed here.

Change-Id: I65b0eee44336e4627620443861092b8988f2e01d
2019-03-27 09:57:41 +00:00
Harald Welte
2f5e7093bf rsl.c: Add missing #include of gsm0808.h
This fixes the below compile error:

rsl.c:900:43: error: ‘gsm0808_chosen_enc_alg_names’ undeclared (first use in this function)

Change-Id: I4aed0242737602e61b785862e3c37c963bf48455
2019-03-27 10:50:28 +01:00
Philipp Maier
dd7cc3cc7c oc2g: change log level for calibration file errors to FATAL
The log level of the messages that notify calibration file loading
problems is NOTICE, but since it is a severe problem when calibration
can not be loaded lets change it to FATAL

Change-Id: I32aed25ca7925f1c776f00b37f404a58a85ddbc7
Related: OS#3823
2019-03-27 07:58:56 +00:00
Philipp Maier
7b96b8832f oc2g: generate failure event report in case of bad calibration
When the TX/RX calibration files can not be loaded a failure event
report should be sent to the BSC. Lets send a failure event report when
calbration data is either bad or can not be loaded (see also remvoed TODOs).

Change-Id: I3318470518b34807a443f7cb78c7091b4a3d4481
Related OS#3823
2019-03-27 07:58:56 +00:00
Philipp Maier
eac4d23421 oc2gbts_mgr: use msgb_talloc_ctx_init() instead of msgb_set_talloc_ctx()
The function msgb_set_talloc_ctx() is deprecated. Lets use
msgb_talloc_ctx_init() as suggested.

Change-Id: I61f80a7b11e9117e8b71c49b7d81d2f959f3150d
2019-03-20 14:48:00 +00:00
Philipp Maier
a4332be9e9 oc2g: l1if: delay trx initialization to avoid race condition
On links with high latency it can happen that RADIO CARRIER OPSTART is
carried out to early, even before SET BTS ATTRIBUTES is carried out.
This means that important parameters for the initalization are not yet
set and the TRX initalization failed. Lets delay the TRX initalization a
bit in order to be sure that all BTS attributes are set before the
initalization is carried out.

Change-Id: Id3bdc88d28417e422d2c0c33b03be06f1a4706c2
Related: OS#3782
2019-03-19 13:56:12 +00:00
Max
6bc6d78b36 Constify pcu_rx_*() parameters
Use const for data parameter where appropriate.

Change-Id: Ia228c001ca07cfde61b540bec6257b62aec93517
2019-03-18 16:28:33 +00:00
Max
965b911583 Make gsm_pchan2chan_nr() static
It's only used inside of gsm_data_shared.c so let's mark it as such.

Change-Id: I83f1783efe9dc07c8bf9901ebc94774aef1cd472
2019-03-18 11:39:07 +00:00
Philipp Maier
708adf1a1f oc2gbts_mgr_vty: remove calls to vty_install_default()
The function vty_install_default() is deprecated and throws a compiler
warning that suggests to remove it, so lets remove it.

Change-Id: I1a4afb6e352bed9a5af794b39b984a7ddef36e08
2019-03-18 10:40:18 +00:00
Philipp Maier
3dd90a09e4 oml: make oml_tx_failure_event_rep() public
The static function oml_tx_failure_event_rep() is a lot easier to use
than the currently implemented signal scheme. Lets make it public so
that we can quickly generate failure event reports.

Change-Id: I9c4601840a06119f35cfe4da453fff3b293fe615
Related: OS#3823
2019-03-18 09:20:58 +01:00
Philipp Maier
fc17dc763f lc15: remove unused define constant FACTORY_ROM_PATH
Change-Id: I76d47471a8480da5a7cb4a11655d5150d4f33508
Related: OS#3823
2019-03-18 08:06:21 +00:00
Philipp Maier
f748c4530c oc2g: remove unused define constant FACTORY_ROM_PATH
Change-Id: I5eb12332568c85bfd2dd83eb5ef1d9c1c9bbfd27
Related: OS#3823
2019-03-18 08:06:12 +00:00
Harald Welte
b509023d34 OC-2G: Nominal transmit power is 25 dBm, not 40
According to the OC-2G product specifiacation, the maximum output power
is 25 dBm.  This should be reflected in the code, there's no point in
claiming to be able to trnasmit 40 dBm - which just creates confusion on
all levels (such as the logs, where Tx power is claimed to be ramped up
to 40 dBm right now).

Closes: OS#3823
Change-Id: Ia6b3476ab2f9279f8905b8c7cfd07ef7b0a939ed
2019-03-05 21:34:08 +01:00
Harald Welte
de3262fd27 OML: Don't advertise baseband transceiver as UNLOCKED at startup
For some strange historical reason, the baseband transceiver MO was
brought up in state "UNLOCKED".

The object should come up in "locked" state until it's explicitly
unlocked by the BSC.

See Section 6.8.2 of TS 12.21: "If there is yet no administrative state
value explicitly set by the BSC (e.g., at an initialization time), the
object shall be presumed to be administratively locked by default"

Change-Id: Id505594b9f224567566caac84dae2e2ae4477fae
Closes: OS#3790
2019-02-23 15:59:18 +01:00
Harald Welte
5eddf98dfc OML: Store merged attributes of IPA OML Managed Objects
For the TS 12.21 standard OML attributes, we store a copy of the
most-recently set value for each attribute in "mo->nm_attr".  This
somehow was missed when adding support for the IPA specific MOs like
those relevant for GPRS.

Change-Id: I75ebda46da9c1fcecc484311bf3833f31c536ee1
2019-02-23 15:59:10 +01:00
Pau Espin Pedrol
b3fb33adea oc2g: vty: Compilation error fixes due to commented code
Change-Id: Id2b16b9acd15d0c80085fac0fdc2a57173ebb0a0
2019-02-20 00:04:51 +01:00
Pau Espin Pedrol
d8afcc143a oc2g: Remove unused static function
Change-Id: I4d0a476f84bc9e92e02f94c3990daddeeaa3c5d5
2019-02-20 00:03:33 +01:00
Pau Espin Pedrol
6b5bbee25f oc2g: Remove unused variables
Change-Id: I6738adb6b0ae50905351c67c259d7a77cb250624
2019-02-20 00:02:34 +01:00
Pau Espin Pedrol
546056c9c8 oc2g: fsync requires fd instead of file stream
Similar fix was done for lc15 in a8041edb.

Change-Id: Idcd9dc48ea2e1f80bfdf5cf8b6bf55d8150fe0d2
2019-02-19 23:47:41 +01:00
Pau Espin Pedrol
f3fa1d384d oc2g: led_sleep_cb: pass correct ptr to llist_move_tail
Fix compilation warning. At runtime it's not a big issue because the
"list" field is the first field of the led_list (struct
lc15bts_led_timer_list) variable. Hence, the address passed is the same.

Similar to commit fixing same issue in lc15 in 080302f8.

Change-Id: Ie393a21bc3a725520343c70941cb4f591b313420
2019-02-19 23:43:23 +01:00
Pau Espin Pedrol
45b9021eb8 oc2g: Cleanup of get_hwversion_desc
Remove unused variables, wrong return type values, etc.

Change-Id: I5565b904c72a9ac1775818416f05c64722d366b2
2019-02-19 23:42:44 +01:00
Pau Espin Pedrol
b3e7a888c9 oc2g: Add get_hwversion_desc to header file
it's used in oc2g/main.c and it needs to be in a header file.

Similar as previously done for lc15 in 19795c5a.

Change-Id: Ic6826d8c8ff5c648158493454a80704bb956b51d
2019-02-19 23:30:11 +01:00
Pau Espin Pedrol
3713b59368 oc2g: Fix compilation error (comment mark inside comment)
Change-Id: Ib27b31825744ea397b5b4eb258da78f5f834895c
2019-02-19 23:21:07 +01:00
Max
f788aefe6f Enable statsd support
Change-Id: I9112d9fd527cdc29d89868df40c6845a751c4865
2019-02-18 13:40:03 +01:00
Philipp Maier
12d362fe09 scheduler_trx: use stored fn for pdtch data indications
When the ph-data indications for the PDTCH are passed up to l1sap,
then a forumla is used to calculate the frame number of the beginning of
the block that is just passed up. This is not necessary since the start
frame number of the block is stored in *first_fn when the block arrives.
We should use this frame number instead. (For the measurement indication
it is already done this way).

Change-Id: I6c01987be78203acfa689c6decb2c806f8fff3d6
Related: OS#2977
2019-02-15 17:52:07 +01:00
Max
fa8b9e2aa3 Log lchan kind on PCU-related error
Change-Id: Iadb464e7040dd11e4a8cabfc96d6d90f32594109
2019-02-14 21:46:34 +00:00
Max
de9e2092c9 osmo-bts-trx: add extended (11-bit) RACH support
Attempt to decode incoming RACH burst as 11-bit first
and fallback to 8-bit if unsuccessful.

Change-Id: Ia28741603636406744e5e22ffff1fb7a9689955a
Related: OS#1854
2019-02-14 15:48:08 +00:00
Harald Welte
3933e930c3 OML: Work around OsmoBSC sending "GET ATTRIBUTES" with short length
OsmoBSC used to have a bug in encoding the "GET ATTRIBUTES" OML message,
resulting in the actual message length being three bytes longer than the
encoded length value.

As in Ib98f0d7c2cff9172714ed18667c02564540d65d7 we have introduced
proper consistency checks on length values, all "GET ATTRIBUTES" from
OsmoBSC version suntil today will fail.  This patch introduces a
work-around to remain compatible with old OsmoBSC while still keeping
the consistency checks for all other messages.

Change-Id: Ifa24e9e2c71feb2c597557807d675438c2825b2d
Related: OS#3799
2019-02-12 20:29:50 +01:00
Harald Welte
906357c5e2 OML: Properly reject short messages and truncate over-long messages
For OML, what matters is the length indicated in the OML message header.

If we don't have sufficient bytes, reject the message and send a failure
event report.

If we have more bytes, truncate the message at the number of bytes
indicated in the OML length header.

Change-Id: Ib98f0d7c2cff9172714ed18667c02564540d65d7
2019-02-12 20:28:49 +01:00
Harald Welte
e160ac6ea5 OML: Reject segmented OML messages
TS 12.21 describes segmenting of OML messages using placement
fist/middle/last and the "sequence' number of the OML header. We don't
implement this and hence must ignore or reject any related messages.

Before this patch however, we simply treated such segments as if they
were a complete OML message.  Let's fix that.

Change-Id: Idd42cf4edc1bf9ab366853bd9b0f7afd9c060910
Closes: OS#3795
2019-02-12 20:08:56 +01:00
Harald Welte
96bded3ebd OML: Use 'const struct abis_oml_mo *' whenever users only read
Try to constrain the code a bit further by making all read-only
accesses use 'const *'.

Change-Id: I5a61e6d1b4e5e083bb24017166186dc87d035cd0
2019-02-12 20:08:18 +01:00
Harald Welte
ccc7ba17c0 OML: Report short messages even for invalid TRX numbers in down_fom()
Change-Id: I65b57d3fc714814db3ae3fd34398f307413fece8
2019-02-12 20:08:18 +01:00
Harald Welte
055c29bc6b OML: Reduce code duplication in down_mom/down_fom
Simply use a "mo" variable on the stack rather than having duplicate
but otherwise identical calls to oml_tx_failure_event_rep()

Change-Id: Ibe6c79e95405b13d041047549d2ffa39aa355eb2
2019-02-12 20:08:18 +01:00
Harald Welte
e57a62deee OML: send proper OML alerts in case of errors
Change-Id: I5b19b82a4874617c7c584cf3eac55eb9c756710a
2019-02-12 20:08:08 +01:00
Harald Welte
268ba55a6e OML: remove double-logging on oml_tx_failure_event_rep()
When we send an OML failure event report using
oml_tx_failure_event_rep(), the function itself will not only send
the report to the BSC but also log it.  So there's no need to both
have an explicit LOGP() and a call to oml_tx_failure_event_rep().

Change-Id: Ib3fd06b3266d896aebeed4ebe42ac71ff173bb5c
2019-02-09 09:08:27 +01:00
Harald Welte
742dad5b69 OML: Don't overwrite MO instance before oml_tx_failure_event_rep()
In Change-Id Ic163bcfb6361a8ebd39e0bc0f238ef51e2cb214e we introduced
several additional calls to oml_tx_failure_event_rep() during OML
messaeg processing.  However, for some reason, we *overwrite* the
bts_nt/trx_nr/ts_nr of the TRX MO.  This is clearly wrong.  The
"address" of a managed object doesn't change at runtime!

Change-Id: Idfb80ccd6dd485d52dc006867fae3dde3fb005f3
2019-02-09 09:08:27 +01:00
Harald Welte
02231177a9 OML: Ensure MOs are initialized with valid "Administrative State'
When osmo-bts connects to the BSC, it sends a ton of "State Change Event
Report" messages indicating the Operational State (NULL), Availability
status (power off) and [as an osmocom extension] also the Administrative
State. However, the value of the administrative state is "0", which is
not defined in TS 12.21 Section 9.4.4

Change-Id: I03f8a4b08b266cd40036076c76f9dc7e8bf08da2
Closes: OS#3785
2019-02-09 09:08:27 +01:00
Harald Welte
893e499e0c OML: Return attributes in ACK/NACK messages
As per 3GPP TS 12.21 Section 8.2 "ACK messages shall return all the
attributes in the original message". OsmoBTS fails to do so but simply
sends no attributes at all in the ACK.

TS 12.21 is a bit vague whether or not the attributes shall also be
achoed in the NACK.  Let's do it and append the CAUSE in this case.

Closes: OS#3788
Change-Id: Ifb305fe75f8305bb04872f26492b8b1bb8c27f49
2019-02-09 09:08:22 +01:00
Harald Welte
3c89e2c36a OML: some more comments on what functions do
Change-Id: I5f30f6c556968fab60283ff1948966af28dc6e83
2019-02-08 22:09:29 +01:00
Harald Welte
9c9232c993 scheduler_trx: Fix erroneous multiply-by-four
Commit acefd0586e introduced the "toa256"
resolution change.

Before the change, _sched_compose_ph_data_ind() used quarter-bits as
units, so multiplying the old "toa" value by four made sense.

However, after said change, the value is in 1/256th of bits, and hence
we need to report the toa256 value without any multiply-by-four.

Change-Id: I9f980236ea1cd635cb229290e187747cc8c86d8d
Related: OS#2977
2019-02-05 17:46:25 +01:00
Daniel Willmann
5c205639f1 doc/examples: Install OC2G config files with autotools
Change-Id: I2fd587e91b5e0e4cd1b8ffa781f65dbfd4484f19
2019-01-30 10:35:13 +01:00
Daniel Willmann
3bf27cefbb systemd: Install OC2G service files with autotools
Change-Id: Ifd37b6a01ad9007a9e887fe3dd208dc74047b4d8
2019-01-30 09:40:52 +01:00
Vadim Yanitskiy
e8ebbe300c common/vty.c: fix 'cfg_phy_no_inst_cmd' command description
A comma is needed to separate a command definition from its
description, not the parts of description. Let's fix this.

Before this patch:

  OsmoBTS# configure terminal
  OsmoBTS(config)# phy 0
  OsmoBTS(phy)# no?

    no  PHY Instance number

  OsmoBTS(phy)# no ?

    instance
    osmotrx   OsmoTRX Transceiver configuration

After this patch:

  OsmoBTS# configure terminal
  OsmoBTS(config)# phy 0
  OsmoBTS(phy)# no?

    no  Negate a command or set its defaults

  OsmoBTS(phy)# no ?

    instance  Select a PHY instance to remove
    osmotrx   OsmoTRX Transceiver configuration

Change-Id: If10d85abc6506118ba08c37e8101f423d6f838ea
2019-01-27 15:31:01 +03:00
Harald Welte
e1dade0471 Bump version: 0.8.1.199-5c93-dirty → 1.0.0
Change-Id: Ie33252aef4144f9bb825d7c234970fd4e6083bb2
2019-01-20 20:38:25 +00:00
Daniel Willmann
5a266511bf dump_docs: Use new config file naming scheme
Change-Id: I05723ef50deb918ed1131c1d30f8e613351b3be5
2019-01-17 17:07:44 +01:00
Daniel Willmann
a4649308eb Rename oc2g config file to match new naming scheme
examples/oc2g/osmo-bts.cfg->examples/oc2g/osmo-bts-oc2g.cfg

Change-Id: Ie49d5695ea78da2995252c56c75ce42e6cec0e9c
Related: SYS#4444
2019-01-17 17:07:43 +01:00
Harald Welte
5c93677be5 osmo-bts-trx/loops.c: Make code control flow more readable
Use the 'else' construct where applicable to avoid too many return paths
from functions

Change-Id: I819f0c80e90855e8b3252795c837f8e3053b6e87
Related: OS#1622, OS#1851
2018-12-23 10:38:23 +00:00
Harald Welte
5d9cb9f555 osmo-bts-trx/loops.c: Use lchan name based logging
The loops.c code dates back to ancient times when we printed the TRX
number and the raw channel number to identify a logical channel.  We
meanwhile have gsm_lchan_name() and should use it to log messages
related to this lchan in a common format.

This commit introduces the LOGPLCHAN() helper macro [similar to
osmo-bsc], and uses it from loops.c.

As a result, some functions don't need a chan_nr argument anymore,
while some need to add a new lchan argument.

Change-Id: I6976dd7444c26b1f52741bc367b0311ebbef1718
Related: OS#1622, OS#1851
2018-12-23 10:38:23 +00:00
Harald Welte
a4f5622408 osmo-bts-trx/loops.[ch]: Make functions "void" if they always return 0
The concept of a return value only makes sense if there's actually ever
something non-constant to return, and if the caller actually processes
that return value.  If we always "return 0" and ignore it on the caller
side, functions should be of "void" type.

Change-Id: I3575a2cef75f3fd4c3f95eddb40719d28a055b54
Related: OS#1622, OS#1851
2018-12-23 10:38:23 +00:00
Harald Welte
3379250b51 osmo-bts-trx/loops.c: Add comments documenting TA + MS power control loop
The loops.c code is not very easily understood, so let's add some
comments to it.

As can be seen, there are functions of integer type which always return
0, and whose callers don't check for the return value.  This will be
adressed in subsequent patches.

Change-Id: Iafea07eb751ed85d29b214576bb0d31ea919cd72
Related: OS#1622, OS#1851
2018-12-23 10:38:23 +00:00
Pau Espin Pedrol
719c6a9135 rsl: Send PDCH ACT NACK if TCH chan is still active
Fix recent commit which broke TTCN3 BTS_tests
TC_dyn_ipa_pdch_tchf_act_pdch_act_nack.

Prior to the breaking commit, logic was still not good, because
1- It didn't return after sending the NACK
2- It sent a NACK in all cases, while for PDCH DEACT we want to force
its deactivation. Going through tests it can be seen that indeed it
can deactivate it in that case:
rsl.c:2206 (bts=0,trx=0,ts=3,pchan=TCH/F_PDCH as PDCH) Request to PDCH DEACT, but lchan is still in state ACTIVE
...
rsl.c:2103 (bts=0,trx=0,ts=3,ss=0) Tx PDCH DEACT ACK

Fixes: 133a3d96dc ("rsl: Avoid sending ipa PDCH DEACT NACK followed by ACK")
Change-Id: I6d6d12aec10c801fe55012ca6e58d0bc8755b15d
2018-12-23 10:22:25 +00:00
Pau Espin Pedrol
8564ececa5 sysmobts_mgr: Add support for gpsd < 2.96
This allows running sysmobts-mgr on systems with old gpsd releases
(which may have other software depending on such old release).

GPSD_API_MAJOR_VERSION define was first added in gpsd 2.39, before that
it didn't exist (but this code is known to work against 2.38).

GPSD_API_MAJOR_VERSION == 5 was set in version 2.96.

Related gpsd commits:
3771dba081bd1175adab6096d7b6270d3822aaa1
e69bcb6b01af6b25c6a525fb1961b92ac04f5213

Related: SYS#4290
Change-Id: If3c35021a020a61d5fa3cde5eebcd09908db822b
2018-12-18 21:40:00 +01:00
Pau Espin Pedrol
17ffb08de0 sysmobts_mgr: Prepare code for gpsd < 2.96 support
API prior to that version allocates the pointer internally. Let's change
current code to always use a pointer and in current supported code (gpsd
>= 2.96) point it to a user-allocated struct.

Follow-up patch will introduce necessary ifdefs to support older gpsd.

Change-Id: Iaeb5ac527cc3e58168027021d0f60afa93d1fb6f
2018-12-18 21:40:00 +01:00
Oliver Smith
fc88d8e7dc contrib: fix makedistcheck with disabled systemd
EXTRA_DIST files need to be distributed, no matter if the systemd option
is configured or not.

Change-Id: I5d3712b54a8b777c33a9804a4f612e4f37f829df
2018-12-06 13:43:26 +01:00
Oliver Smith
9c4a6facdb contrib/jenkins_*.sh: build and publish manuals
Add new environment variables WITH_MANUALS and PUBLISH to control if
the manuals should be built and uploaded. Describe all environment vars
on top of jenkins_bts_model.sh. Change the top description line to look
like all the other contrib/jenkins.sh files (from other repositories),
so it is clear that this is the entry point of Jenkins (and not the
other contrib/jenkins_*.sh scripts).

When WITH_MANUALS is set, install osmo-gsm-manuals like any other
dependency and add --enable-manuals to the configure flags (for "make"
and "make distcheck"). Add the bin subdir of the installed files to
PATH, so osmo-gsm-manuals-check-depends can be used by ./configure.

Related: OS#3385
Change-Id: If51194cc595bd8cf1081b35ab0e1a5ddcd448860
2018-12-05 13:10:55 +01:00
Pau Espin Pedrol
c606103d9f bts-trx: (n)ack PDCH DEACT only after TRX answered SETSLOT
Before this patch, PDCH DEACT was (n)acked to the BSC without taking
into account if TRX succeeded or failed to set the TS:

20181123044720655 DRLL rsl.c:2523 (bts=0,trx=0,ts=0,ss=0) Rx RLL DATA_REQ Abis -> LAPDm
20181123044720700 DRSL rsl.c:2805 (bts=0,trx=0,ts=6,pchan=TCH/F_PDCH as PDCH) ss=0 Rx RSL IPAC_PDCH_DEACT
20181123044720700 DRSL rsl.c:2205 (bts=0,trx=0,ts=6,pchan=TCH/F_PDCH as PDCH) Request to PDCH DEACT, but lchan is still active
20181123044720700 DRSL rsl.c:2131 (bts=0,trx=0,ts=6,ss=0) Tx PDCH DEACT NACK (cause = 0x0f)
20181123044720700 DPCU pcu_sock.c:124 Sending info
20181123044720700 DPCU pcu_sock.c:139 BTS is up
20181123044720700 DPCU pcu_sock.c:232 trx=0 ts=7: available (tsc=7 arfcn=868)
20181123044720703 DPCU pcu_sock.c:608 Deactivate request received: TRX=0 TX=6
20181123044720703 DL1C l1sap.c:1519 deactivating channel chan_nr=TCH/F on TS6 trx=0
20181123044720703 DTRX trx_if.c:242 Enqueuing TRX control command 'CMD NOHANDOVER 6 0'
20181123044720703 DL1C l1sap.c:648 deactivate confirm chan_nr=TCH/F on TS6 trx=0
20181123044720703 DRSL rsl.c:714 (bts=0,trx=0,ts=6,ss=0) not sending REL ACK
20181123044720703 DRSL rsl.c:2264 (bts=0,trx=0,ts=6,ss=0) PDCH DEACT operation: channel disconnected, will reconnect as TCH
20181123044720703 DL1C scheduler.c:593 Configuring multiframe with TCH/F+SACCH trx=0 ts=6
20181123044720703 DTRX trx_if.c:242 Enqueuing TRX control command 'CMD SETSLOT 6 1'
20181123044720703 DL1C l1_if.c:780 (bts=0,trx=0,ts=6) bts_model_ts_connect(as_pchan=TCH/F) success, calling cb_ts_connected()
20181123044720703 DRSL rsl.c:2339 (bts=0,trx=0,ts=6,ss=0) PDCH DEACT operation: timeslot connected as TCH/F
20181123044720703 DRSL rsl.c:2440 (bts=0,trx=0,ts=6,ss=0) TCH/F_PDCH switched to TCH/F mode (ts->flags == 0)
20181123044720703 DRSL rsl.c:2103 (bts=0,trx=0,ts=6,ss=0) Tx PDCH DEACT ACK
20181123044720704 DTRX trx_if.c:492 Response message: 'RSP NOHANDOVER 0 6'
20181123044720705 DTRX trx_if.c:492 Response message: 'RSP SETSLOT 0 6 1'

Change-Id: I888de761b65c3ea8bfe623fcf009f3b2b57c926c
2018-12-04 16:57:52 +00:00
Oliver Smith
19ff607e99 Fix DISTCHECK_CONFIGURE_FLAGS override
Set AM_DISTCHECK_CONFIGURE_FLAGS in Makefile.am instead of
DISTCHECK_CONFIGURE_FLAGS. This is the recommended way from the
automake manual, as otherwise the flag can't be changed by the user
anymore.

Related: OS#3718
Change-Id: I332c94502cce0f3f11fe3f4d9f6c9918ff0c0263
2018-12-04 16:13:16 +01:00
Pau Espin Pedrol
11465b5ba1 oc2g: Fix headers missing during make distcheck
Change-Id: I2e4aad190c44fea047b4aefcf55335789fa4c571
2018-12-04 16:06:31 +01:00
Oliver Smith
26701bbe85 build manuals moved here from osmo-gsm-manuals.git
Moved to doc/manuals/, with full commit history, in preceding merge commit.
Now incorporate in the build system.

Build with:

$ autoreconf -fi
$ ./configure --enable-manuals
$ make

Shared files from osmo-gsm-manuals.git are found automatically if
- the repository is checked out in ../osmo-gsm-manuals; or
- if it osmo-gsm-manuals was installed with "make install"; or
- OSMO_GSM_MANUALS_DIR is set.

Related: OS#3385
Change-Id: I728ebb56ade6dda079a0744c4e592284e1bea4f6
2018-11-27 17:56:09 +01:00
Neels Hofmeyr
0133b65da1 Merge history from osmo-gsm-manuals.git
Change-Id: Ib62d046bd84204b902cac3fe8c0765e32da0a0c6
2018-11-27 17:54:38 +01:00
Daniel Willmann
b7eaf282dd OsmoBTS: Fix typo
Change-Id: I0a4c9f052f14816e88ed0a4a5fff9b3854da195a
2018-11-27 17:54:20 +01:00
Daniel Willmann
473be4f89f OsmoBTS: Print VTY command in fixed-width font
Surrounding with '@' didn't seem to yield the intended result, the
charactars appeared in the compiled document.

Change-Id: I66e7949fa4a6c2164bf9572a2beaf8ace169fa1c
2018-11-27 17:54:20 +01:00
Pau Espin Pedrol
9bcda3742d bts: Fix typo
Change-Id: I47758acec07a587730552a9c46dc02976c807d9a
2018-11-27 17:54:20 +01:00
Harald Welte
094b22ea82 vty-ref: Update URI of docbook 5.0 schema
... to match the /etc/xml/catalog file on debian (no "www" in hostname)

Change-Id: Id9f3579c7f2bc3af13fe30b5268f249b6f59ed0d
2018-11-27 17:54:20 +01:00
Pau Espin Pedrol
035d209809 Introduce chapter trx_if.adoc and add it to OsmoTRX and OsmoBTS
This chapter defines the protocol used between osmo-trx and
osmo-bts-trx.

Most of the text comes originally from osmo-trx.git/README, as it's the
only known documentation of the protocol other than the code itself.

Change-Id: I56c418eef0f826ae1aadbed5b151fbed241c7885
2018-11-27 17:54:20 +01:00
Pau Espin Pedrol
446f368fd0 OsmoBTS: bts-models: Add Lime Microsystems devices as supported osmo-trx
Also take the chance to remove uneeded extra whitespace in surrounding
text.

Change-Id: I739e4dfba7c649a74cf67d6bbe6f74b22e7e24f0
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
0a421119c8 refactor Makefile build rules, don't use the FORCE
The initial goal was to make sure we don't have overall FORCE rules causing
unnecessary rebuilds -- annoying while writing documentation. As I looked
through possible dependencies, I finally understood what's going on here.

Remove code dup and nicely sort which belongs where in build/Makefile.*.inc. In
each, describe in a top comment how to use it, and also unify how they are
used:

- Rename Makefile.inc to Makefile.docbook.inc and refactor
- Add Makefile.vty-reference.inc
- Add Makefile.common.inc

Make sure that we accurately pick up all dependencies.

Drop use of the macro called 'command', that silenced the actual command lines
invoked and replaced them with short strings: it obscures what is actually
going on and makes the Makefiles hard to read and understand.

Each manual's makefile is greatly reduced to few definitions and a Makefile
include, e.g. one for asciidoc, one for VTY reference.

Move common/bsc_vty_additions.xml to OsmoBSC/vty/libbsc_vty_additions.xml, link
from OsmoNITB. It applies only to OsmoBSC and OsmoNITB.

Add a script that combines a VTY reference file with *all* additions files
found in a manual's vty/ dir. Call this from Makefile.vty-reference.inc.

Change-Id: I9758e04162a480e28c7dc83475b514cf7fd25ec0
2018-11-27 17:54:20 +01:00
Pau Espin Pedrol
ea9d5b9499 Allow easily disabling GFDL references
All parts referencing GFDL can be easily disabled by removing the
'gfdl-enabled' attribute from the document.

Change-Id: I2489726ad2e90301bceadfada926e31ae0f85986
2018-11-27 17:54:20 +01:00
Harald Welte
2283831b64 update osmo-bts-virtual documentation, now that code is merged
Change-Id: Icd8706d29ca0e96cb89b7736dbb62f9ce159382d
2018-11-27 17:54:20 +01:00
Pau Espin Pedrol
eaef0af3a2 rtp-amr: Fix typo and trailing whitespace
Change-Id: I8efda2387e0e5e95700b070dab8f8dd427fa562d
2018-11-27 17:54:20 +01:00
Pau Espin Pedrol
fa53c9eafe rtp-amr: Describe requirement to recieve all PH-DATA.ind events
Change-Id: I4a78b3398c36a8107fa1809ba9b89235980f0e4f
2018-11-27 17:54:20 +01:00
Pau Espin Pedrol
683b775c7a OsmoBTS: Update osmotrx ip to diff between local and remote
Change Id of the code implementation: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5

Change-Id: Ia4c70b3b8436e2647fc35d579a302dfbf32a83f0
2018-11-27 17:54:20 +01:00
Pau Espin Pedrol
7000ef5dea OsmoBTS/chapters/configuration.adoc: Add bts index in example
Change-Id: If13643cdfa59c50b6af8ab0657635fed2ca219f0
2018-11-27 17:54:20 +01:00
Max
3b835505bf Sync DTX FSM with OsmoBTS code
Change-Id: I050a07db99bc0038cfd2a9646a450f714653d804
2018-11-27 17:54:20 +01:00
Philipp
8a1dfa0b77 Describe how to run multiple instances of osmo-nitb and osmo-bts
Change-Id: I69adeef85adda6f08b31b7d176f51e16968c1435
2018-11-27 17:54:20 +01:00
Ivaylo Kostov
f87f1113ca BSC,BTS: add diagrams of PCU-BTS-NITB-SGSN relationships
Change-Id: I0eb09706efb768fa4f6810872fb6568cbc9838cb
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
dd4160e003 dynamic timeslots: add BSC level config instructions
Add high level description on and a config example for dynamic timeslots in a
new chapter featured in the OsmoBSC and OsmoNITB manuals.

From the OsmoBTS manual's chapter on dynamic timeslots, add references to the
above.

Change-Id: I44ff1e4c2340c65ff23e85408fc6d6a45ea9e046
2018-11-27 17:54:20 +01:00
Max
08b14a2fac Add DTX implementation details to RTP AMR
Add FSM and description.

Change-Id: Ib37cb6e4038f970070c1715269961db7172ce377
2018-11-27 17:54:20 +01:00
Max
5fd42960d6 Move RTP AMR doc to top level
Add it to Makefile with proper docinfo so it's build automatically
alongside with other documentation.

Change-Id: Iacd7fadc003ce0f9ffd20aa5b36c7d598b04f882
2018-11-27 17:54:20 +01:00
Harald Welte
dbb4c0389e rtp-amr.adoc: Fixes to Message Sequence Charts
Nutaq added these clarifications/extensions/fixes tothe message sequence
charts.

Change-Id: Ic699bda828947ff616c3d80783026e21d853f962
2018-11-27 17:54:20 +01:00
Harald Welte
932f6753d1 rtp-amr.adoc: New TCH/AHS downlink chapters
Nutaq contributed the following chapters:
* TCH/AHS Downlink: FACCH/H During DTX Operation
* TCH/AHS Downlink: Inhibited SID_UPDATE
* TCH/AHS Downlink: Inhibited SID_FIRST_P1

Change-Id: I55d8e9f98694b39514d1f31c517a80050103fdd6
2018-11-27 17:54:20 +01:00
Harald Welte
a9b521e2cb rtp-amr: TCH/AHS Uplink: FACCH/H During DTX
New chapter contributed by Nutaq:
* TCH/AHS Uplink: FACCH/H During DTX operation

Change-Id: I4a9c58e02dcfeb388ff3a30ba321ea3cec325518
2018-11-27 17:54:20 +01:00
Harald Welte
d61b59bb18 rtp-amr.adoc: TCH/AFS Downlink: Inhibiting
Add two new chapters contributed by Nutaq:
* TCH/AFS Downlink: Inhibiting a SID_FIRST frame
* TCH/AFS Downlink: FACCH/F During DTX Operation

Change-Id: Ic39d035f9d17bd0634c2df78ae3359a5eb7dfd46
2018-11-27 17:54:20 +01:00
Harald Welte
d7f1457bed rtp-amr.adoc: TCH/AFS Uplink
Add new chapter by Nutaq for Speech Frame Following a SID_FIRST frame

Change-Id: Ib7cfb07525ea311d9dac051a6e139b0ae0549504
2018-11-27 17:54:20 +01:00
Harald Welte
529c1f04cb Documentation on AMR RTP in case of DTX
Change-Id: I394f405b441c1eb000759151bd8350d5b3a84a0b
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
8be01aac1e fix build: abis: re-add dependencies
Below commit accidentally removed osmobts-abis.pdf from the Makefile entirely.
The pdf was re-added, but the dependencies are still missing, so that
osmobts-abis.pdf is not rebuilt when abis/* is newer. Fix that.

Culprit: 05f5adbe837f2cbfb9301cdb8c9b454ca0bfc825
"OsmoBTS: add vty reference documentation"

Half-fix: 707827196f0734eefa74ce0c35c2ab2fe754cc4c
"OsmoBTS: generate osmobts-abis.pdf again"

Change-Id: Id2ee8177cfb8eb58409d164bdd994ef5e86ad82b
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
c1ac0d8b6a OsmoBTS/abis/rsl: split dyn TS ladder diagrams to fit on page
Split both of the lengthy mscgen generated ladder diagrams in two so that the
diagrams are split over two pages and don't bleed into the page footer.

Change-Id: If90250123a85cd275f07c69ee64c6e10a7269f06
2018-11-27 17:54:20 +01:00
Alexander Couzens
2c160a5dc4 OsmoBTS: generate osmobts-abis.pdf again
broken by 05f5adbe837f2cbfb9301cdb8c9b454ca0bfc825

Change-Id: I7ca18e3d7fa3a5a6eac0590b919b4c664f73671c
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
a4683812ed fix 'make clean': shell glob, ignore failure
Unfortunately a glob like osmo-x__*.{svg,png} doesn't work, so have the
suffixes in separate globs.

Add dashes to indicate that failure should be ignored.

Change-Id: I6bc4d9ea72b43a573acbc860c23397f748de2c7b
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
8580b9717f OsmoBTS/abis/rsl: combine separate dyn ts sections
There were two separate sections saying basically the same. Move the
entire 'Dynamic Channel Combinations' section further above and combine
with the 'IPA Style PDCH Management' section to avoid repetition.

Change-Id: Ic370ba34de5cb14f0194ff8c8661e45d7ca98e2b
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
236e9d575e add 'make check' target
Generate *.check files from asciidoc output and grep for WARNINGs.
Add *.check files to gitignore and to 'make clean'.

Change-Id: Ibccc83a3415930a528f2e8e4e4dda3b81c6d0b64
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
3537fa6224 make clean: also remove generated image files
Change-Id: I80798e79b4ccee64f26f58f9754de02b2958e33e
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
8b633e885b OsmoBTS/abis/rsl: add missing info for Osmocom Dyn Channels
The section 'Osmocom Style Dynamic Channels' ended in mid-sentence without
naming any of the hard facts. Complete that.

Add section links.

Change-Id: Ib92895fe1bb89fb1b14dc8fcbd88b98bbb6edeee
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
e332b4ca4e OsmoBTS/abis/rsl: cosmetic: 'IPA style'
Consistently name the PDCH act methid 'IPA style', name ip.access only once
in the 'IPA Style Dynamic Channels' section.

Consistently write 'IPA style' without hyphen (not 'IPA-style').

Capitalize section headers ('IPA Style').

Change-Id: I91112c2d8af9424ebe7e1972fd4ef9c77d24a7b4
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
de954a1aa0 OsmoBTS/chapters/configuration.adoc: fix index numbering
Change-Id: Ibe507fe36e0130377dec361d56fd75596ca64e75
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
e834518123 osmobts-usermanual.adoc: fix link to abis.adoc chapter
The chapter is in ../common/chapters, not in ./chapters

Change-Id: I698d83e96cb77900b99a0bd383587b1b68182efb
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
9c74ccc4c8 OsmoBTS/chapters/dynamic-timeslots.adoc: Remove obsolete links
Those file never existed and the ladder diagrams are instead at
OsmoBTS/abis/dyn_ts*msc.

Change-Id: Icbae85b959e80afe7f272a11f33064a3e594da53
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
2729bcfb93 OsmoBTS/abis/rsl.adoc: fix missing section header
In effect, this fixes the dangling references from the table of RSL messages
with additions/limitations to the Chan Act message description.

Change-Id: Ic6f83f016ce9ec90af7eb0af1b1f71a10263915d
2018-11-27 17:54:20 +01:00
Alexander Couzens
ad4866b35f OsmoBTS: add vty reference documentation
Including the required changes of the Makefile which is now simliar
as the other projects Makefile's.
Based on: OsmoBTS 0.3.0.283-f869

Change-Id: Id7362ce1c584b1926330b93770d68453e091c71c
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
00d13cf84c OsmoBTS/abis/dyn_ts_osmocom_style.msc: adjust PDCH Act ack
The act ack for switchover to PDCH is now issued immediately, after
commit 'dyn TS: if PCU is not connected, allow operation as TCH'.
Adjust the chart accordingly.
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
00ad09612e OsmoBTS/abis/rsl: fix subtitle for ladder diagram of osmo dyn switchover 2018-11-27 17:54:20 +01:00
Daniel Willmann
e10b4d3713 Add section about configuring power-ramping 2018-11-27 17:54:20 +01:00
Harald Welte
51c04e0fd7 osmobts-abis: Add Revision log regarding dynamic cannels 2018-11-27 17:54:20 +01:00
Harald Welte
7a3ec76a2f spelling: message discriminator, not descriminator 2018-11-27 17:54:20 +01:00
Neels Hofmeyr
c03c9c81fb Document dynamic channels on Abis, both IPA and Osmocom style
Based in ladder diagram and WIP wording for IPA style from Neels
Hofmeyr, completed by me.
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
47d5ba4012 OsmoBTS: hardware support: remove dup, tweak wording
Don't mention the common part twice.
Use plural for hw specific parts.
No commata before 'and'.
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
a998d1040a OsmoBTS: wording tweak 2018-11-27 17:54:20 +01:00
Neels Hofmeyr
8f1eae6642 OsmoBTS: typos
'3GPP specified': when talking about written information, one usually uses
the present tense '3GPP specifies'.
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
b14f6569fd abis/oml.doc: remove duplicate sentence part 2018-11-27 17:54:20 +01:00
Max
e61a2eb734 Add OsmoBTS control interface description 2018-11-27 17:54:20 +01:00
Jonathan Brielmaier
1454a2c752 fix various typos across all manuals 2018-11-27 17:54:20 +01:00
Neels Hofmeyr
bfb1257dce OsmoBTS: explain IEs marked 'ignored' *and* 'Received' 2018-11-27 17:54:20 +01:00
Neels Hofmeyr
e0064a8d2a OsmoBTS: s/content of this attribute/this attribute/ 2018-11-27 17:54:20 +01:00
Neels Hofmeyr
d7c4778aca OsmoBTS: fix typos, streamline language style 2018-11-27 17:54:20 +01:00
Neels Hofmeyr
f450f40c12 OsmoBTS: typo x2 ('Objects Classes' -> 'Object Classes') 2018-11-27 17:54:20 +01:00
Holger Hans Peter Freyther
0078ba7af2 OsmoBTS: Fix the author name and mail address 2018-11-27 17:54:20 +01:00
Harald Welte
391c057769 Add link to Asciidoc source code of manual 2018-11-27 17:54:20 +01:00
Harald Welte
524fdd3ac8 initial checkin of manuals to public repo
The manuals existed in different form for several years in an internal
sysmocom repository.  However, since they had just recently been
converted from docboox-xml to asciidoc and all files have been
re-shuffled for enabling the public release, there's not much point in
keeping the history with git-filter-branch.
2018-11-27 17:54:20 +01:00
Neels Hofmeyr
a6a18b66ee Importing history from osmo-gsm-manuals
Change-Id: I99bf0fcac4059d3eb8274ff5ee79b490efbdda59
2018-11-27 17:53:51 +01:00
Pau Espin Pedrol
e3cb8715f5 bts_model: Allow TS connect to be processed asynchronously
This commit doesn't change internal logic of any model, only the API to
be able to return result of connect TS asyncrhonously since some models
(like osmo-bts-trx) require some time to process the result. This way
PDCH ACT/DEACT (N)ACK can be sent once the result of this long process
is known. For instance, nowadays in osmo-bts-trx we PDCH (DE)ACT ACK
before getting the result from SETSLOT on the TRX iface.

With this new API, bts_model_ts_connect doesn't return any value
synchronously. Instead, it is expected to always end up calling
cb_ts_connected with the return code from the TS activation process. 0
is considered a successs, while any other value is considered an error.

Change-Id: Ie073a4397dd2f1a691968d12b15b8b42f1e1b0cf
2018-11-26 14:08:14 +01:00
Pau Espin Pedrol
47c8f37c9f cosmetic: fix whitespace
Change-Id: Iaa4552844db33fe69da5ed7028dbfa0100c33900
2018-11-26 14:08:14 +01:00
Pau Espin Pedrol
3c12325d28 bts-trx: early return on POWERON success
Later on it's expected to add more rsp parsing, so let's return here and
not depend on generic return further down.

Change-Id: I8ddee46374ab329c47dc68e720e236f13d393f66
2018-11-23 17:44:13 +01:00
Pau Espin Pedrol
133a3d96dc rsl: Avoid sending ipa PDCH DEACT NACK followed by ACK
It was spotted during osmo-gsm-tester test
dynts:trx-sysmocell5000+mod-bts0-dynts67-ipa+cfg-codec-fr-any that
osmo-bts-trx was answering to PDCH DEACT from BSC first with a NACK
followed immediatelly after by an ACK. That happens after the test does
a GPRS pdp ctx act successfuly and then deactivates the ctx and the 2 MS
try to place a call between them (and thus channels need to be moved to
TCH/F).

Most probably the if condition where the lines for this commit are
modified need to be fine-grained. Patch before this one should help to
understand the steates/situation in this scenario, and then a follow-up
patch can be created to improve the logic.

Change-Id: I91c65da6b6b7094f32187d3b083153a87c3219fd
2018-11-23 16:58:18 +01:00
Pau Espin Pedrol
52fdef79cc rsl: Log lchan state during dynts PDCH->TCH
Change-Id: Iee5ac0550afda71fce67b0340749c111b364bb4f
2018-11-23 16:47:39 +01:00
Max
ecfb83d3cc Drop unused function
Change-Id: Ib1ecc6dcb243da27976ca0e90a83aefa18a65b76
2018-11-22 10:54:37 +00:00
Max
faf501e432 Fix type mismatch
llist_count() return unsigned value, let's use it for counter as well.

Change-Id: I81097a64ef694bec046afcc23cf995dc539a706b
2018-11-22 09:02:41 +00:00
Vadim Yanitskiy
70eb683622 Fix deprecated gsm_arfcn2band(), use gsm_arfcn2band_rc()
Change-Id: I45aae70f4bc3f4f85d267dafb757debdef1bb7d7
2018-11-22 15:30:46 +07:00
Vadim Yanitskiy
07af4e1751 common/vty.c: fix deprecated osmo_str2lower() usage
Change-Id: I4f78bc13908c2d9dfbe24195ae6e35fae8575c59
2018-11-22 14:15:17 +07:00
Pau Espin Pedrol
6dacc35c75 bts: Fix TRX0 param initialization
TRX0 is allocated in a different place than other TRX.

Commit that introduced the bug added an initialization step
(bts_trx_init) applied in VTY cmd "trx <0-254>", where TRX are allocated
since same commit, but doesn't initialize TRX0 for reasons explained in
first paragraph.

As a result, some parameters were not applied to TRX0, like
power ramping increment step, which prevented MS from finding the network in
osmo-gsm-tester tests.

Fixes: eebb6a4216 ("bts: Allocate TRX for BTS dynamically, deprecate -t")
Change-Id: I5afd66548634ff53e2af24dc7055d408ca8ca4e3
2018-11-21 19:59:21 +01:00
Pau Espin Pedrol
36a61df7a6 bts-trx: Allow re-try without exit if POWERON fails in osmo-trx
If POWERON fails, announce to BSC that the TRX is not available, and
announce it as available as soon as POWERON success is received.

Related: OS#3692
Change-Id: Iaa8f497381038fd7f9f779a8211ebc6453837c65
2018-11-20 10:41:43 +01:00
Pau Espin Pedrol
825797cfcb common: Implement OML for trx_set_available(1)
Related: OS#3692
Change-Id: I1ba32c162a8a98ed0fdd4190227de66270679e5a
2018-11-20 10:40:09 +01:00
Pau Espin Pedrol
9d17840f83 bts-trx: setup timer once at creation time
The setup is only needed once, so no need to set it every time we want
to schedule it.
Furthermore, it will ease new code introduced in follow-up patches,
which will schedule this timer under some circumstances without need to
send a message at the same time (because re-try of a cmd after a delay
is wanted).

This commit adds an alloc function and an init function to keep
different parts of the code decoupled and avoid exposing more
implementation details between them (like exposing the trx_if timer).

Change-Id: I3b6461d0130d25284e673c5efce0b3832c48bbb5
2018-11-20 10:37:58 +01:00
Stefan Sperling
fc2ff394e0 add missing check of osmo_wqueue_enqueue() return value
The return value of osmo_wqueue_enqueue() isn't checked.
This can result in a memory leak if the message cannot
be enqueued. Log an error an free the message upon failure,
as done elsewhere.

Change-Id: I5671ca364f31d98f2b28d028e7bf1797386de2ec
Related: CID#57662
2018-11-19 12:21:05 +01:00
Stefan Sperling
20284c4dbc properly initialize si3 in test_is_ccch_for_agch_setup()
Prevent potential use of uninitialized memory in paging test.

Change-Id: Ie8f8fc3c4a9e4cc18fc85b6822110de79da4246b
Related: CID#188828
2018-11-19 11:10:37 +00:00
Pau Espin Pedrol
0716a20f98 bts-trx: trx_if: Use struct to store CTRL msg parsed responses
Change-Id: Icb84bce0621042afa4301678ba1cc58d8e3662bb
2018-11-19 10:43:56 +00:00
Max
116ac855cc osmo-bts-trx: print TRX socket addresses in 'show transceiver'
Change-Id: I081305d730cbdb14b5ce1dbfee18673328225b66
2018-11-19 05:44:36 +00:00
Pau Espin Pedrol
eebb6a4216 bts: Allocate TRX for BTS dynamically, deprecate -t
No need to pass -t num_trx anymore to specify number of TRX to use. It
is calculated based on dynamic allocation from VTY config.
Using parameter -t is flagged as deprecated and is transformed into a
NOOP por backward compatibility.

As a result, TRX now are allocated after the BTS is allocated and
initial config (pre-VTY) is applied.
A new function bts_trx_init() is added, to set default config on each
TRX during allocation and before setting VTY config on it.
A new per BTS model function bts_model_trx_init() is added, to allow
per model specific default configuration of each TRX.

Change-Id: Iab1a754ab12a626759f9f90aa66f87bdce65ac9c
2018-11-18 20:29:40 +00:00
Stefan Sperling
e5f4654ee3 prevent potential NULL dereference in virtbts's tx_tchh_fn
If chan_state->ongoing_facch is set, this code's logic
suggests that both msg_facch and msg_tch could be NULL.
Don't dereference msg_tch unconditionally.

Change-Id: Icf5584396c5b925d55ca9380dd4f869ae5d72da3
Related: CID#172047
2018-11-06 15:51:05 +01:00
Pau Espin Pedrol
2910b78305 {oc2g,sysmo}-mgr-calib: Fix build against gpsd >= 3.18
Change-Id: I1f9176432b3a01bd5e8c179dc269e391df2d446f
2018-10-29 18:17:04 +01:00
Omar Ramadan
9c75c387c0 Add OC-2G BTS sources
Change-Id: I327384fe5ac944dc3996a3f00932d6f1a10d5a35
2018-10-27 11:35:58 +00:00
Vadim Yanitskiy
ee9e8e9eb2 common/scheduler.c: track TDMA frame loss per logical channels
This change modifies the logic of TDMA frame loss tracking. To
be more precise, the tracking logic was moved from per timeslot
level to per logical channel level, what makes OsmoBTS more
accurate in its measurements.

But before getting into details, it's important to clarify some
things about the Uplink burst processing in transceiver (OsmoTRX).
If an Uplink burst is detected, OsmoTRX demodulates it and sends
to OsmoBTS. If nothing is detected on a particular timeslot,
OsmoTRX will do nothing. In other words, it will not
notify OsmoBTS about this.

Meanwhile, there are usually a few logical channels mapped to a
single TDMA timeslot. Let's use SDCCH8 channel configuration as
an example (simplified layout):

  /* SDCCH/8 (ss=0), subscriber A (active) */
  { TRXC_SDCCH8_0,    bid=0 },
  { TRXC_SDCCH8_0,    bid=1 },
  { TRXC_SDCCH8_0,    bid=2 },
  { TRXC_SDCCH8_0,    bid=3 }, // <-- last_fn=X

  /* SDCCH/8 (ss=1), subscriber B (inactive) */
  { TRXC_SDCCH8_1,    bid=0 },
  { TRXC_SDCCH8_1,    bid=1 },
  { TRXC_SDCCH8_1,    bid=2 },
  { TRXC_SDCCH8_1,    bid=3 },

  /* SDCCH/8 (ss=2), subscriber C (active) */
  { TRXC_SDCCH8_2,    bid=0 }, // <-- current_fn=X+5
  { TRXC_SDCCH8_2,    bid=1 },
  { TRXC_SDCCH8_2,    bid=2 },
  { TRXC_SDCCH8_2,    bid=3 },

SDCCH8 has 8 sub-slots, so up to 8 subscribers can use a single
timeslot. Let's imagine there are three subscribers: A, B, and C.
Both A and C are active subscribers, i.e. they are continuously
transmitting UL bursts, while B is not using ss=1 anymore.

The original way of TDMA frame loss tracking was the following:

  - when an UL burst is received, store it's frame number in
    the timeslot state structure (last_fn);

  - when the next UL burst is received on same timeslot, compute
    how many frames elapsed since the last_fn;

  - if elapsed = (current_fn - last_fn) is lower than 10, then
    iterate from (last_fn + 1) until the current_fn and send
    dummy zero-filled bursts to the higher layers;

  - otherwise (elapsed > 10), process the current burst,
    and do nothing :/

According to our example, subscriber A is sending 4 bursts, then
nobody is sending anything, and then subscriber C is sending
4 bursts. So, there is a 4 frames long gap between the both
transmissions, which is being substituted by dummy bursts. But,
as the logical channel on ss=1 is not active, they are dropped.

This is not that scary, but the current algorithm produces lots
of false-positives, and moreover is not able to track real frame
drops in longer periods (i.e. >10). So, tracking the frame loss
per individual logical channels makes much more sense.

Let's finally drop this hackish 'while (42) { ... }', and track
the amount of lost / received TDMA frames (bursts) individually
per logical channels. Let's also use the multiframe period as
the loss detection period, instead of hardcoded 10. And finally,
let's print more informative debug messages.

Also, it makes sense to use the amount of lost / received bursts
during the calculation of the measurement reports, instead of
sending dummy bursts, but let's do this separately.

Change-Id: I70d05b67a35ddcbdd1b6394dbd7198404a440e76
Related: OS#3428
2018-10-25 17:51:33 +00:00
Pau Espin Pedrol
34018dd4c9 Convert lchan CCCH_LCHAN to chan_nr BCCH and viceversa
Before this patch it was being coded as SDCCH4 TS0 SS 0, and as a
result the state LCHAN_REL_ACT_OML applied in opstart_compl in abused
SDCCH4 TS0 SS 4 was not being checked when deciding whether to send a
Chan Act ACK in rsl_tx_chan_act_acknack.

Fixes: OS#3513
Change-Id: I1641960c9ffbb3ed0de74ab5b53e24e5b4ff3397
2018-10-22 13:18:23 +02:00
Pau Espin Pedrol
e6ce1718ae gsm_pchan2chan_nr: Fix conversion of CCCH_LCHAN
Previous implementation made no sense, since chan_nr is never read
before being set below from lchan_nr.

Furthemore, if lcahn_nr=CCH_LCHAN=4, then:
cbits = 0x4 + lchan_nr = 0x8 = b1000 which then becomes SDCCH8 according
to GSM 08.58 9.3.1, so it's totally wrong:
SDCCH/8 + ACCH     0 1 T T T

Change-Id: Id1dee716991e6faa406f02c029e998af5780162a
2018-10-22 12:49:15 +02:00
Harald Welte
44bfa4c7fd scheduler_trx.c: Switch to osmo_timerfd() of libosmocore >= 0.12.0
Change-Id: I721d493659fde57eca1543b2e63171df1be1279d
Fixes: Coverity CID#178646
2018-10-21 13:05:53 +02:00
Pau Espin Pedrol
2fb4a8d825 rsl_rx_chan-activ: Improve logging information
Change-Id: I9b9a666e195ea729503ecd707e1582268c190e09
2018-10-10 13:44:23 +02:00
Pau Espin Pedrol
0bbc56b8f3 l1sap: Log name of chan_nr instead of hex value
Change-Id: If98e130d17f1d153a13ba28f48a0a563731fde41
2018-10-10 13:43:04 +02:00
Pau Espin Pedrol
84f3ec644a lchan_meas_check_compute: Log value during incorrect num of SUB measurementes detected
Change-Id: I5dacbed5517b2aa2a6bbc66ec125f0bdfd1f5b2b
2018-10-10 13:29:27 +02:00
Vadim Yanitskiy
36413548e0 common/pcu_sock.c: cosmetic: explicitly address lchan
In the most cases a PDCH time-slot has only one logical channel
allocated. In case of both osmo-bts-trx and osmo-bts-virtual,
there are two kinds of logical channels: PDTCH and PTCCH,
but since they share the same chan_nr value, deactivating
one of them would trigger deactivation of another one.

Let's explicitly address the first logical channel in array.

Change-Id: I8edcb46e887c4db63a425eba89cec4374165763e
Closes: OS#3023
2018-10-07 04:19:12 +07:00
Pau Espin Pedrol
2d21c9ff22 abis: inp_s_cbfn: Improve logging signal related information
Change-Id: Ia63b69882c74155bcae2e027a21ea7e319647256
2018-10-03 14:39:38 +02:00
Harald Welte
3ee09a47c1 sysmo, virtual: properly handle BS-AG-BLKS-RES as received from BSC
Change-Id: Ifd9a3be6189b3288526e12260d68a982b089404e
2018-09-30 15:50:01 +02:00
Harald Welte
173555dab7 Fix computing CCCH block number from frame number
The existing implementation used a simplistic macro, which was wrong
in many ways:

1) it returned a negative value for "fn % 51 < 5" conditions without
   raising any error message or asserting
2) it returned a wrong block number for many different input frame
   numbers, as it didn't account properly for the FCCH/SCH gaps between
   the blocks

Let's replace the simplistic macro with a proper lookup table based on
TS 05.02, and let's OSMO_ASSERT() if this is ever called with non-CCCH
frame numbers.

Change-Id: I11fd6cc558bb61c40c2019e46f56c1fe78ef39f5
Closes: OS#3024
2018-09-30 15:50:01 +02:00
Harald Welte
2c1a46a2dd paging_test: Fix AGCH/PCH split test for second half of 102 multiframe
* we have to use modulo 51, not 50
* the check for FACCH/SCH has to be applied to to the fn % 51 result

Change-Id: I540a7eeef3ea3ed7347f0f1b5a5a6fe7ce0ec8bb
2018-09-30 15:50:00 +02:00
Vadim Yanitskiy
85485c3db4 contrib/jenkins_*.sh: drop rudimentary '--with-osmo-pcu'
The '--with-osmo-pcu' flag dates back to a time where the
'pcu_interface' header was not copied in both repositories
and you had to point one to the other.

Change-Id: I79e494484cb099cc9ca8c27c38b785c5ea8c3bc6
Closes OS#3514
2018-09-30 11:49:21 +00:00
Neels Hofmeyr
eeba57652a vty: mark 'rtp bind-ip' deprecated, not hidden
The command implementation says "deprecated", so then the vty command attribute
should also be DEPRECATED. It will be hidden from online docs and vty
reference.

Change-Id: I23e620f1b947e129989fe69c6380c91b9abf7021
2018-09-26 07:28:20 +00:00
Harald Welte
4e3fdbc738 lc15bts_mgr_vty: Ensure writing well-formed config files
Every new node level should only add one additional space, not two!

Change-Id: Ic890429a6ff1e0c89fe1c6a159c6ee6ecbcf9a5a
2018-09-25 20:55:07 +02:00
Harald Welte
73dd4ff027 ensure all config file examples are well-formed
We used to permit multiple spaces to enter a new node in the config,
but modern osmo* code writes config files well-formed where every node
equals exactly one indent level.

Change-Id: I3da56b34e87503c46e6bf3c7505b83ec5e6aaa20
2018-09-25 20:11:42 +02:00
Pau Espin Pedrol
080302f870 lc15: led_sleep_cb: pass correct ptr to llist_move_tail
Fix compilation warning. At runtime it's not a big issue because the
"list" field is the first field of the led_list (struct
lc15bts_led_timer_list) variable. Hence, the address passed is the same.

Change-Id: Ib8bf07990800d74bfb3ad7a55eccfc65e40cd480
2018-09-21 13:46:50 +00:00
Vadim Yanitskiy
b9f3e14ba6 common/rsl.c: tweak log message in lapdm_rll_tx_cb()
During the investigation of OS#3559, it was discovered that the
log message, which warns that an RSL message was dropped due to
inactive logical channel, has incorrect log level - LOGL_INFO.

This is not informative kind of message, so let's increase the
log level, and additionally let's print the hexdump of message
and it's length.

Change-Id: I26eac5e4466c493ffe08dbb89de20f5e1c2bb85d
2018-09-19 13:15:19 +07:00
Harald Welte
9ce4d91948 CBCH: Some more scheduler_mframe cleanup
As the CBCH replaces SDCCH sub-slot-2 in downlink, we should mark
the uplink as IDLE, just as the associated SACCH in uplink and downlink.

Also, there are no burst_numbers in IDLE slots.

Change-Id: Ib8565d1d0080bfce5d2aec77609709a445a2171c
2018-09-17 22:47:45 +02:00
Harald Welte
b222f6666d CBCH: Fix CBCH implementation for osmo-bts-trx
Unfortunately the code in Icc15603079a1709ec094f400a9bcf0008211890f
was incomplete as it missed a few spots where the CBCH-enabled channel
types weren't yet covered.

Using this patch I can both still perform RACH / Location Update as
well as actually receive SMSCB messages on an attached phone (Galaxy S5).

Change-Id: I311b141668549ef37054cbe74be66bf17ac1d7e6
Closes: OS#1617
Closes: OS#3559
2018-09-17 22:47:45 +02:00
Harald Welte
6434ba9f90 CBCH: sprinkle some OMSO_ASSERT() and guard against talloc failure
Change-Id: I85fdecbf20de83a6f925765a46b5cd14765da03e
2018-09-17 21:36:59 +02:00
Harald Welte
c799c70c59 CBCH: Add FIXME comments on queue overflow/underflow handling
Change-Id: Ida97f25ab4bf7e4d0f03b13396cb37cdfe99ef40
2018-09-17 21:36:59 +02:00
Harald Welte
3c87f5c3ea get_lchan_by_chan_nr(): Fix resolution of CBCH
The CBCH (as per GSM specs) always maps on sub-slot 2 of either
the SDCCH/4 or SDCCH/8 that it replaces.  However, the way how we
express it as RSL-style channel number (0xC8) doesn't allow room
for any sub-slots.  The top 5 bits are used for expressing CBCH, while
the bottom 3 bits are used for the timeslot number (TN).

So when transforming from channel number to lchan, we must handle the
CBCH case specially by using a hard-coded sub-slot number of 2.

Change-Id: I44e2f763d5d25311167f435f2ca7e030b2a3f009
Related: OS#1617
2018-09-17 21:36:59 +02:00
Harald Welte
3941cf4479 CBCH: Fix CBCH via L1SAP for osmo-bts-{sysmo,octphy,litecell15}
This fixes a bug introduced in "CBCH: Move processing via L1SAP"

commit 02d99db08b
Author: Harald Welte <laforge@gnumonks.org>
Date:   Fri Aug 24 23:37:45 2018 +0200

where the full channel number 0xc8 was used instead of the
(right-shifted) C-bits only.

Change-Id: I0fd8d7762e9cc3319a534f261e8857a1aa2220e0
2018-09-17 21:36:54 +02:00
Harald Welte
7c82b4a872 l1sap/scheduler: Consistently print chan_nr as hex number
It's very confusing if some log messages log chan_nr as decimal, while
most log it as hexadecimal.  Let's standardize on hex everywhere.

Change-Id: Ia6566d5bbee8124fb7c689c962ce34d714208503
2018-09-17 20:53:37 +02:00
Pau Espin Pedrol
19795c5ab2 lc15: rewrite and refactor code to print hwversion description
Also print a newline at the end of print_hwversion().

In the process of rewrite, fix several warnings in the few lines of this functions:
osmo-bts/src/osmo-bts-litecell15/main.c: In function ‘print_hwversion’:
osmo-bts/src/osmo-bts-litecell15/main.c:162:12: warning: passing argument 1 to restrict-qualified parameter aliases with argument 4 [-Wrestrict]
   snprintf(model_name, sizeof(model_name), "%s Rev %c",
            ^~~~~~~~~~
    model_name, (char)rev);
    ~~~~~~~~~~
osmo-bts/src/osmo-bts-litecell15/main.c:168:12: warning: passing argument 1 to restrict-qualified parameter aliases with argument 4 [-Wrestrict]
   snprintf(model_name, sizeof(model_name), "%s (%05X)",
            ^~~~~~~~~~
    model_name, model);
    ~~~~~~~~~~
osmo-bts/src/osmo-bts-litecell15/main.c:162:47: warning: ‘ Rev ’ directive output may be truncated writing 5 bytes into a region of size between 1 and 64 [-Wformat-truncation=]
   snprintf(model_name, sizeof(model_name), "%s Rev %c",
                                               ^~~~~
osmo-bts/src/osmo-bts-litecell15/main.c:162:3: note: ‘snprintf’ output between 7 and 70 bytes into a destination of size 64
   snprintf(model_name, sizeof(model_name), "%s Rev %c",
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    model_name, (char)rev);
    ~~~~~~~~~~~~~~~~~~~~~~
osmo-bts/src/osmo-bts-litecell15/main.c:168:47: warning: ‘ (’ directive output may be truncated writing 2 bytes into a region of size between 1 and 64 [-Wformat-truncation=]
   snprintf(model_name, sizeof(model_name), "%s (%05X)",
                                               ^~
osmo-bts/src/osmo-bts-litecell15/main.c:168:44: note: using the range [0, 4294967295] for directive argument
   snprintf(model_name, sizeof(model_name), "%s (%05X)",
                                            ^~~~~~~~~~~
osmo-bts/src/osmo-bts-litecell15/main.c:168:3: note: ‘snprintf’ output between 9 and 75 bytes into a destination of size 64
   snprintf(model_name, sizeof(model_name), "%s (%05X)",
   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    model_name, model);
    ~~~~~~~~~~~~~~~~~~

Change-Id: I079b056a04fe77d2f7f361ff5899232cb70b5a93
2018-09-16 10:45:01 +00:00
Pau Espin Pedrol
a8041edb5b lc15: fsync requires fd instead of file stream
Change-Id: I7efb7280363b3a021b30c3b4eacb3aab70e9c8da
2018-09-16 10:44:55 +00:00
Pau Espin Pedrol
5fceb9fc3a lc15: vty: Add missing include for lchan_deactivate
Fixes following compilation warning:
osmo-bts/src/osmo-bts-litecell15/lc15bts_vty.c:244:3: warning: implicit declaration of function ‘lchan_deactivate’

Change-Id: Id9b144d068d53393e1c1887aad285ae757156ec6
2018-09-16 10:31:13 +00:00
Vadim Yanitskiy
0c1ca01084 osmo-bts-trx/l1_if.c: cosmetic: fix typo in debug msg
There is a big difference between both L1 and L2 frames. In the
first case, a TDMA frame is assumed, while a L2 frame is the
result of decoding a few bursts (e.g. 4 for xCCH) arrived
on a few TDMA frames.

Anyway, the purpose of l1if_process_meas_res() is to handle
measurements, not frames.

Change-Id: Ic4362c2869e658c2f42664b4009a30e777f8048c
2018-09-16 12:27:37 +07:00
Pau Espin Pedrol
755088a79c doc/examples/Makefile: Install bts-mgr cfg files used by systemd services
Change-Id: Iaf362da2a9ebd6829391637252812c2be93e9c60
2018-09-14 15:12:28 +02:00
Philipp Maier
27a86005f3 measurement: fix unit-test test_lchan_meas_process_measurement
The unit test that tests lchan_meas_process_measurement() only inputs
test data to lchan_meas_process_measurement() but it is not checked if
the interval end could be detected or not.

- Add a return code to lchan_meas_process_measurement()
- Ensure that the return code is checked in the unit-test

Change-Id: I9e00ce683e8c44528804f65181dbfed9e85e3aed
Related: OS#2975
2018-09-13 14:27:12 +00:00
Philipp Maier
c78759055a measurement: remove missed interval end detection
The function is_meas_overdue() was introduced to allow
lchan_meas_process_measurement() to detect when the end of a measurement
interval has been missed. Interval ends may be missed when the SACCH
block of the related measurement interval gets lost. This is due to the
fact that the SACCH block is used as a trigger to start the measurement
result computation.

The idea behind is_meas_overdue() was to check the frame number of the
current measurement against the frame number of the previous measurement
in order to see if there was a measurement for SACCH in between or not.
Unfortunately SACCH and TCH Voice data is not necessarly processed in
order by each phy. Depending on the phy there may be a jitter between
the timing of SACCH and TCH Voice. Depending on the phy this jitter may
be enough to mess up the timing so that we see a SACCH block earlier
than expected. So we can not use the current frame number of TCH Voice
measurements to check for missed SACCH blocks.

Change-Id: Idfdbf64c1f965f35c12559b3995e2b746c74ee9e
Related: OS#3502
Related: OS#2975
2018-09-13 14:27:12 +00:00
Philipp Maier
6d701d0e05 cosmetic: fix typo in comment
Change-Id: I6a1147e2a3858475c99c99ceb33d7d416f3cac6c
2018-09-13 14:27:12 +00:00
Pau Espin Pedrol
8a6f6c5a16 Install sample cfg file to /etc/osmocom
Change cfg file names so they don't overlap when installing different
osmo-bts versions, and make systemd services look for correct new name.

Remove unneeded duplicated EXTRA_DIST files from root dir Makefile.am

Change-Id: I75fdd06cc52ce50628efb1f9b007d2e3926db27d
2018-09-12 19:10:28 +02:00
Pau Espin Pedrol
65d3cc7753 Install systemd services with autotools
Change-Id: I87299134696bbfc6721b1226d4de6c73854aa846
2018-09-12 14:16:49 +02:00
Keith Whyte
17577b7c00 fix handling of odd pchans in bts_supports_cm()
Convert the if-cascade to a switch().

For any unexpected pchan kind, reject the chan mode immediately instead of
going on to invoke gsm_bts_has_feature on feature = _NUM_BTS_FEAT, and log the
error.

Tweaked-by: neels
Change-Id: Ieaded9258554b15fcc4b7f05d5a8847175b7962f
2018-09-11 00:28:10 +02:00
Keith Whyte
734eb40e72 log: add error log for RSL Chan Mode Modif
Add log context to chan_mode error in rsl_rx_mode_modif().

Tweaked-by: neels
Change-Id: I945cf1ca8660ad5daf097edab1833bbc74b6185f
2018-09-11 00:28:10 +02:00
Neels Hofmeyr
cb01259804 fix RSL Chan Mode Modif for dyn TS
Fix the chan mode checking for RSL Chan Mode Modif: do not reject
all modes on dyn TS.

In rsl_rx_mode_modif(), bts_supports_cm() should never
be fed with dynamic pchan kinds (e.g. GSM_PCHAN_TCH_F_TCH_H_PDCH).
Feed instead the return value of ts_pchan() that is to say,
the actual pchan type (e.g. GSM_PCHAN_TCH_F).

Change-Id: I7f0c835b25289931bccf96e982ea5564c8be4192
2018-09-11 00:28:04 +02:00
Harald Welte
386c33fa84 CBCH: Use llist_first_entry_or_null() instead of reinventing it
Change-Id: I376111e71d1c7be35a8fd7e392488adc34e21941
2018-09-09 15:40:58 +00:00
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
Harald Welte
02d99db08b CBCH: Move processing via L1SAP
for some historical reason, CBCH handling was not using the normal
L1SAP boundary.  Let's change that and traverse L1SAP just like for
e.g. BCCH which is quite similar to CBCH handling.

This also has the added benefit of logging CBCH via GSMTAP.

Change-Id: Ibdba4c5e808330f8406f441a97fe0e81170fce97
Closes: OS#3534
2018-09-09 15:40:58 +00:00
Harald Welte
4280829dfa [sysmo,lc15]: Consider CBCH channel combinations in chan_nr_by_sapi()
Whenever a CBCH is used, this results in a new physical channel
combination on the relevant timeslot.  The chan_nr_by_sapi() function
must handle those cbch-enabled PCHAN types.

Change-Id: I963909bcec8392ec445d0bcf53a2a8d7d9535444
2018-09-09 15:40:58 +00:00
Harald Welte
dcde6145bf CBCH: Fix rejecting SMS-CB related RSL messages
Normally, the "Common Channel" related RSL messages should actually
contain such a common channel.  However, since cell broadcast is
implemented inside what's essentially a downlink SDCCH, we should add
some explicit exceptions.

Before this patch, any RSL SMS BC CMD would have been discarded and
an RSL Error Indiciation returned.

Change-Id: I2f7f1dd43505cc27cd33489d8b0e8c981cd93880
Closes: OS#3533
2018-09-09 15:40:58 +00:00
Pau Espin Pedrol
cfc052743b Move systemd service to contrib/systemd
Move it there and have only a symlink in debian/, like we do in all
other projects.

Change-Id: I213d3816a66e88069c31f85b3fbf462d1222aa43
2018-09-06 14:25:59 +00:00
Philipp Maier
0b6c1762c5 measurement: display fn_mod when measuremnet is added
When adding a new measurement also log the frame number by the modulus
of the measurement interval to simplify debuggung

Change-Id: I77a4d947dab32de0d5717ebf13bd8de6179dfe6a
2018-09-06 12:33:03 +02:00
Philipp Maier
bd3462f355 paging: add unit-test to check different bs_ag_blks_res settings
The parameter bs_ag_blks_res, which is loaded into the BTS via the SI3
setting, defines how many of the CCCH blocks shall be used for AGCH. The
remaining CCCH blocks will then be available as PCH for paging.
Unfortunately there is no unit-test yet that verifies that all of the 8
different settings for bs_ag_blks_res.

- Separate the the decision logic that checks if a given fn is part of
  an AGCH into a function to have it available in the unit-test.
- Add a test that checks all possible bs_ag_blks_res settings.

Change-Id: Ib9652f4013a4da3766852f8f03ce9ec5590f6989
Related: OS#1575
2018-08-31 12:44:31 +00:00
Philipp Maier
bf87717cc8 measurement: add SUB measurements in test_lchan_meas_process_measurement
The unit-test function test_lchan_meas_process_measurement() does not
tag measurements as SUB. Lets make the test function more realistic by
setting the is_sub flag at the correct positions.

- Add SUB-Measurements in the correct position
- Print log lines when adding measurements for sub, also fix
  minor bugs in the log printing.

Change-Id: I25c361b21a406c0017ee586f0492c38f2e737e57
Related: OS#3502
Related: OS#2975
2018-08-30 12:45:53 +00:00
Philipp Maier
9680a4746f measurement: substitue missing measurements
At the moment the measurement calculation of osmo-bts works by
collecting the measurement reports the phy emits during a measurement
interval. Normally one would expect a well defind fixed number here, but
some phys will not emit a measurement report for lost blocks. Also
blocks and their reports may get lost because of cpu overload etc.

The computation that is executed at the end of the measurement interval
computes over all received measurement. This evenutally means that
missing measurements will not taken into account and the result will
look better than it is in reality.

To fix this, the interval must be of a defined size and in cases where
less measurements as expected were collected, the algorithm must assume
they have been received with a 100%BER and take that into account.
However, all RSSI and TA/TOA related computations should continue to
rely on actual measurement data.

- make sure the algorithm works over a fixed interval
- replace missing measurements with 100%BER
- fix and extend unit-tests

Change-Id: Idd30fc07603ad7d042c1fb416e247c3bf7d35c8b
Related: OS#2987
2018-08-30 09:12:59 +02:00
Philipp Maier
fb70a2edda cosmetic: test_is_meas_overdue() does not test is_meas_complete()
The function is_meas_overdue() does not use is_meas_complete() anymore
and therefore the related log output is wrong. Lets correct this.

Change-Id: I9b7aa2f7a7c75bc3eed0c94b6ef9d17e7e36ce96
Related: OS#2975
2018-08-29 17:04:59 +00:00
Philipp Maier
42495a156d cosmetic: rename *_meas_rep_fn10* to *_meas_rep_fn10*_by_*s
The lookup table that control the measurement interval endings do not
make clear what their indexes refer to. Lets give them more distinct
names.

rename sdcch8_meas_rep_fn102 to sdcch8_meas_rep_fn102_by_ss
rename sdcch4_meas_rep_fn102 to sdcch4_meas_rep_fn102_by_ss
rename tchf_meas_rep_fn104 to tchf_meas_rep_fn104_by_ts
rename tchh0_meas_rep_fn104 to tchh0_meas_rep_fn104_by_ts
rename tchh1_meas_rep_fn104 to tchh1_meas_rep_fn104_by_ts

Change-Id: I3dc891e1860109f803c1bfa46445e8fef35586d9
Related: OS#2975
2018-08-29 17:04:59 +00:00
Philipp Maier
324a3cd66e measurement: fix is_meas_overdue() and increase testcoverage
The tests TC_meas_res_sign_sdcch4 and TC_meas_res_sign_sdcch8 are
failing mainly because lchan->ts->nr is confused with lchan->nr.
There is also a small problem with one of the formulas that compute
fn_missed_end.

- Add explainatory comment to the lookup tables on what the index
  is refering to
- use lchan-nr instead of lchan->ts->nr when dealing with SDCCH/4/8
- simplfy and fix the formula
- increase the testcoverage of the unit tests, give SDCCH/4/8 also
  a thorough check.

Change-Id: I5d555a21003943bf720c53f3a611029ba45339a9
Related: OS#2975
2018-08-29 17:04:59 +00:00
Philipp Maier
9b41b36e97 measurement: add unit tests for ts45008_83_is_sub()
The function ts45008_83_is_sub() is an integral part of the measurement
calculation as it automatically tags incoming measurements as SUB
measurements. This is important in the context of DTX. Unfortunately
there is no unit test for this function yet.

- Add unit test for ts45008_83_is_sub()

Change-Id: Ia26774859f4bf31baee075896905079368bddd42
Related: OS#3502
2018-08-29 17:34:49 +02:00
Philipp Maier
76c292ea5d measurement: fix sub frame table for TCH/H, SS1
The Table that lists the fn%104 frame number masks that define which of
the incoming measurements to be recognized as SUB measurements contains
one wrong number.

For comparison see also:
3GPP TS 05.08, chapter 8.3 Aspects of discontinuous transmission (DTX)

- Change 29 to 20 in ts45008_83_tch_hs1[]

Change-Id: Id3698551d94866f418e662b9fe81429b16e2621c
Related: OS#3502
2018-08-29 17:34:41 +02:00
Philipp Maier
510158256b measurement: add unit tests for is_meas_complete()
We do not test is_meas_complete() individually yet, but it is an
integral part of the measurement processings since this function decides
where a measurement interval ends.

- Add unit tests that test TCH/F, TCH/H, SDCCH/4 and STDCH/8

Change-Id: I8f89d9e7092cd65ba4d5c5649140692dcc20bdd6
Related: OS#2987
2018-08-29 07:35:57 +00:00
Neels Hofmeyr
1dcd63d36a fix ip.access dyn TS for osmo-bts-trx
For enabling PDCH on a dynamic timeslot, PDTCH and PTCCH SAPIs shall be
enabled. While osmo-bts-sysmo uses the lchan->type to determine which SAPIs to
enable (see lchan_activate() in osmo-bts-sysmo/oml.c:
sapis_for_lchan[lchan->type]), the osmo-bts-trx code instead relies on the
chan_nr indicating RSL_CHAN_OSMO_PDCH = 0xc0 (see trx_sched_set_lchan() in
common/scheduler.c and the PDTCH,PTCCH entries in trx_chan_desc[]).

The 0xc0 cbits are a non-standard invention specifically used for only Osmocom
style dyn TS, so the chan_nr for IPA style dyn TS will and should never include
this cbits pattern. Hence gsm_lchan2chan_nr() correctly always returns the
TCH/F equivalent chan_nr for IPA dyn TS.

Because trx_chan_desc[] relies on the 0xc0 in the chan_nr to activate the PDTCH
and PTCCH SAPIs, internally patch the 0xc0 cbits over the chan_nr in
osmo-bts-trx/l1_if.c for channel de-/activation, iff lchan->type == PDTCH.

This is technically a convoluted mix-up of the cbits usage. Nevertheless, it is
the simplest way to make IPA dyn TS behave the same as Osmocom dyn TS in
scheduler.c.

Apparently, IPA style dyn TS have never worked for osmo-bts-trx before?

Related: OS#3493
Change-Id: I0eed8a135f2ab7e7c0d15ad5c76430b7fe54df3d
2018-08-28 19:38:55 +00:00
Philipp Maier
9f5203d243 cosmetic: remove wrong comment
is_meas_overdue() does not use is_meas_complete() anymore.

Change-Id: I5925fad161843c06e76543d9098c598fe9e72d68
Related: OS#2975
2018-08-28 16:55:22 +02:00
Philipp Maier
02c79f12a4 cosmetic: fix sourcecode formatting
Change-Id: Ia112af0b63478bdcf3cfab2537dc1ba08e03dfb1
Related: OS#2975
2018-08-28 16:54:59 +02:00
Neels Hofmeyr
08062e6dcc cosmetic: abis.c: typo "exixt"
Change-Id: I678ae63626f05a5bb6d890ff37a09e09739bc104
2018-08-24 18:33:13 +02:00
Philipp Maier
0e11bea2a7 osmo_mcast_sock: make sure SO_REUSEADDR is applied
osmo-bts-virtual uses UDP multicast to communicate with its virtphy
counterpart. At the momemnt SO_REUSEADDR is not applied for those
multicast connections because OSMO_SOCK_F_UDP_REUSEADDR is not set. This
makes prevents the proper function of UDP multicast.

- Make sure OSMO_SOCK_F_UDP_REUSEADDR is set

Change-Id: I7f27758b7aa786c8dbae669cbcde10baab8e4845
Depends: libosmocore I1399a428467ca12f1564a14eb8ffb294d4f59874
Related: OS#3497
2018-08-23 20:30:05 +02:00
Stefan Sperling
0b2893f6fc Revert "send TCH/F fill frames in DTX mode (WIP)"
This reverts commit 9bffa87c11.

This commit was not intended to be merged yet.

Change-Id: Ibd8c0899451ae3c17bc07d4e112e32b4897405c9
2018-08-23 13:29:09 +02:00
Philipp Maier
092e4e85b3 measurement: fix measurement interval end detection
for SDDCH4 channels, the detection is not working correctly since the
function uses the lookup table for SDCCH8 interval endings there. This
needs to be corrected. Also there are two unnecessary assignments in
the code which should be removed.

- use correct table (sdcch4_meas_rep_fn102 instead of
  sdcch8_meas_rep_fn102.
- remove unnecessary assignments to last_fn_mod

Change-Id: If8a269ecd3f9fa4eeadf379114db816ef5c77d77
Related: OS#2975
2018-08-22 19:52:14 +00:00
Stefan Sperling
9bffa87c11 send TCH/F fill frames in DTX mode (WIP)
Send DTX TCH fill frames according to GSM 05.08, section 8.3.

Change-Id: I7bff00b8cf41dc1b0e6e668173bebce23be0d253
Related: OS#1950
2018-08-22 19:50:33 +00:00
Stefan Sperling
0ab50934d5 fix conditions for sending fill frames during RTS IND
Rewrite an if-statement to better match the description given
in GSM 05.08, and quote the relevant paragraph in a comment.
Since this entire block of code only runs for SDCCH and TCH,
this new condition should provide the same result expect that
in accordance with the standard we now stop sending fill-frames
on a signalling TCH if DTX is in use.

Also note that this code should already cover parts of the
patch proposed at https://gerrit.osmocom.org/c/osmo-bts/+/5753
The changes to osmo-bts-litecell15/l1_if.c proposed there
should be equivalent to the fill-frame logic in this
existing common BTS code which is handling RTS IND.

Change-Id: Ibaf3ecbd0bde4f37e799d5e2f5d00dc695e0139a
Related: OS#1950
2018-08-22 19:50:33 +00:00
Philipp Maier
4553890d70 measurement: make sure measurement interval end is detected
the measurement interval end is detected by using the measurement
indication that is related to the SACCH block as a trigger to start the
computation. If the measurement indication for the SACCH gets lost
because the block could not be received then the processing is not
executed. This may cause wrong results or when it happens condecutively
an overflow of the measurement sample buffer.

- Store the frame number of the last received measurement indication
- Use the stored frame number to check if an interval was crossed when
  the next measurement indication is received. If we detect that we
  missed the interval, catch up by running the computation and
  start the next interval.

Change-Id: I3a86cd8185cc6b94258373fe929f0c2f1cf27cfa
Related: OS#2975
2018-08-20 18:27:28 +02:00
Philipp Maier
9feddb7edf measurement: make sure state is reset on chan act.
At the moment only lchan_meas_reset is reset on channel activation.
All other states are not reset. This may lead to irretations in the
first measurement interval if there are still leftover messages from
a previous connection. Lets ensure everything is reset to zero by
zeroing out the whole .meas struct in struct lchan.

- Add a centralized function that does the reset
- Call that function from rsl_tx_chan_act_ack() in rsl.c

Change-Id: I880ae3030df6dcd60c32b7144c3430528429bdea
Related: OS#2975
Related: OS#2987
2018-08-20 12:19:30 +02:00
Philipp Maier
b5a28bd967 cosmetic: unify measurement sample handling in one function
In l1sap.c we call lchan_new_ul_meas() and lchan_meas_check_compute()
directly in sequence. Lets unify thos two steps inside measurement.c so
that we only need to call one function from l1sap.c.

Change-Id: If48bc7442dfaab8c36b93949f741de6e836e792a
Related: OS#2975
2018-08-17 16:24:26 +00:00
Stefan Sperling
829263afc4 fix timespec subtraction in compute_elapsed_us()
The previous implementation unconditionally subtracted nanosecond
values from different time measurements, causing overflow if the
current measurement was taken in less of a fraction of a second
than the past measurement. Use timespecsub() instead, which
accounts for nanoseconds correctly.
This is a similar bug as fixed in osmo-pcu for issue OS#3225

While here, switch variables which are calculated based on
struct timespec to 64 bit types. While probably not strictly necessary
in practice, this makes the types used in calculations more compatible.

Change-Id: Idfd9c807e35cd7fb5c80625b9746121f81c24599
Related: OS#3467
Related: OS#3225
2018-08-17 14:25:30 +02:00
Philipp Maier
1c3240c2f1 cosmetic: separate measurement testcase definitions
the testcase definitions in meas_test.c that define different test
situations for uplink measurement are quite large. Lets have them in a
separate file so that the code meas_test.c is easier to maintain.

- Move all mtc* and ulm* structs as well as the struct definitions
  to meas_testcase.h.

Change-Id: I90139ec535056d2cea6de10e77f435d807ce496e
Related: OS#2987
2018-08-16 18:14:10 +02:00
Harald Welte
2222091560 debian/rules: Don't overwrite .tarball-version
The .tarball-version file should contain the *source version* uniquely
identifying the git commit, and not the Debian package name.

With https://gerrit.osmocom.org/#/c/osmo-ci/+/10343/ there is a correct
.tarball-version file in the .tar.xz of the nightly source packages.

Change-Id: Idde432ffd3dae3b7beac77c794e60b6ba555e488
Related: OS#3449
2018-08-06 11:14:17 +02: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
Stefan Sperling
6575f0c3e9 preserve lchan-specific SI overrides on SACCH FILL
During SACCH FILL processing, update lchan SI values only
for lchans which follow BTS-global default values, keeping
lchan-specific overrides in place.

Change-Id: I515bbd9983fa894507386b241863a9aa4d279497
Fixes: eee7247ebe
Related: OS#3173
2018-07-25 12:57:22 +02:00
Stefan Sperling
eee7247ebe update sysinfo copies in all lchans upon SACCH FILL
When a SACCH FILL is received, loop over all lchans and update
their copies of system information data.

This change makes BTS_Tests.TC_sacch_multi_chg pass.

Change-Id: I3e63eeb5fcf320fb029de16e4d327e153cc34567
Related: OS#3173
2018-07-24 19:24:37 +02:00
Pau Espin Pedrol
ed9a13e670 trx: scheduler: Keep RTP clock up to date while in DTXu pause
Upper layer requires us to trigger all events coming from lower layers
in order to keep the RTP clock in sync. In this case, this is done by
sending an empty payload to indicate there's no data to send.

Change-Id: I0bdfb529f35253ca7e531bb9984a3839c3bfe7e8
2018-07-20 16:42:24 +02:00
Pau Espin Pedrol
20278252b5 scheduler: Log error on fn jump
Change-Id: I28f01e3f7fff6f1fb52a3c593a837f4f924bb2d9
2018-07-20 16:41:15 +02:00
Pau Espin Pedrol
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
Pau Espin Pedrol
319b1d5bd7 l1sap: add_l1sap_header: Compact msgb_push ret assignment
Change-Id: Ia427c216cd096d313b234ca244eb71837450e2a9
2018-07-19 16:02:09 +02:00
Pau Espin Pedrol
a9a35419ed rsl: Use value_string to print encryption algo name
Change-Id: I8303364270e73718e57f8efc2f375817b9496ffc
2018-07-06 17:23:54 +02:00
Pau Espin Pedrol
91e7bd7d30 debian: Create dbg package for osm-bts-virtual
Previously all debug symbols were being stored in osmo-bts-trx-dbg.

Change-Id: I9524234cb47c9d5d8e5dc2148c21746e1cd0f10c
2018-07-02 18:57:29 +02:00
Pau Espin Pedrol
a1f09d9105 debian: Make osmo-bts-* packages conflict with old osmo-bts package
Avoid  'osmo-bts' in parallel to the other osmo-bts components from
the OBS generating confusion and not starting binaries (lib conflicts).

Related: OS#3364
Change-Id: Ie8e8d604afeac55530162a69c4dc94e8048ac78d
2018-07-02 18:37:08 +02:00
Pau Espin Pedrol
500b7945f0 Remove unneeded direct libortp dependency
All code in osmo-bts goes through APIs in libosmotrau (osmo_ortp.h),
hence direct dependency is not needed. Fixes OBS warnings:

dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bts-trx/usr/bin/osmo-bts-trx was not linked against libortp.so.9 (it uses none of the library's symbols)
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-bts-virtual/usr/bin/osmo-bts-omldummy debian/osmo-bts-virtual/usr/bin/osmo-bts-virtual were not linked against libortp.so.9 (they use none of the library's symbols)

Change-Id: I96a9b5f0678331dcf66c007928866a124d8700de
2018-07-02 16:36:14 +02:00
Pau Espin Pedrol
2cefb87a48 debian: Package installed example doc files
Change-Id: I9449add4905ecc724c0aa9c8c2d56c6ed4138844
2018-07-02 16:36:14 +02:00
Pau Espin Pedrol
46491d15cd build: Install example cfg files
Files from doc/examples/foo/bar.cfg are install to
/usr/share/doc/osmo-bts/examples/osmo-bts-foo/bar.cfg.

Change-Id: I7525d5a3e1a3c83a54f919cce9096303dd506f35
2018-07-02 16:36:14 +02:00
Pau Espin Pedrol
cf55fbede9 doc: Move calypsoBTS example into trx subdir
CalypsoBTS is a regular osmo-bts-trx with specific config options, so
let's move the cfg file to correct place. This also makes it easier to
install and package example files later on.

Change-Id: Ie2b968c478f1cf4d3e4cb36e4fb743e413cc93f0
2018-07-02 15:06:44 +02:00
Harald Welte
b7b5c4219c Add min/max/std-dev measurement reporting for TOA256
This patch adds extended processing of the high-resolution TOA256
measurement values.  It adds reporting of the following values
for each RSL MEAS REP for uplink measurements:
* minimum TOA256 value during reporting period
* maximum TOA256 value during reporting period
* standard deviation of  TOA256 value during reporting period

Change-Id: Iea4a4781481f77c6163d82dcd71a844a5be87bf2
2018-06-29 17:53:20 +00:00
Philipp Maier
685ded1929 octphy: add support for 16x oversampling mode
The latest octphy firmware release (octsdr-2g-02.11.00-B1927-alpha),
introduces a 16X oversampling option which is not yet supported in
osmo-bts.

- Add oversampling flag in phy_link.h
- Add VTY commands to enable/disable oversampling
- Add phy messages to enable/disable oversampling
- Add conditional compilation to preserve support for legacy
  header files and firmware

Change-Id: Ib78f92bfe03ff20aa0a257763c90844fb7b87cf0
Related: SYS#4257
Patch-by: Octasic inc.
2018-06-28 16:12:25 +02:00
Stefan Sperling
0257f52835 log reception of PCU_IF_MSG_PAG_REQ messages from osmo-pcu
osmo-pcu currently sends paging requests in PCU_IF_MSG_DATA_REQ
messages, rather than PCU_IF_MSG_PAG_REQ. Clarify a comment which
already alluded to this, and leave an explicit log entry if a
PCU_IF_MSG_PAG_REQ message is received.

Change-Id: I75fd8f051f943d876b5614fa088fff7e56b310ab
Related: OS#3018
2018-06-25 11:04:37 +02:00
Pau Espin Pedrol
954e4d8321 jenkins_*.sh: add --enable-werror to configure flags
The flag is enabled for all BTS flavour except for lc15, which still
contain several compilation warnings (fixes submitted to gerrit, but not
merged since no contributor is testing lc15 nowadays).

Change-Id: Ib65056633697dafa63831fc2a480b798df550db6
2018-06-22 11:52:53 +02:00
Pau Espin Pedrol
9215f76443 sysmo: calib_file.c: Avoid decl of unused vars and funcs with femtobts_v2.7 build
Change-Id: I853ff6d3562c5852bff58a07e7c23d49329d9a4f
2018-06-22 11:52:53 +02:00
Pau Espin Pedrol
70fb6d70b1 sysmo: l1_if.c: Avoid decl of unused vars and funcs with femtobts_v2.7 build
Change-Id: I4e6d97114289027fbcff00f77cd42db5277a54ab
2018-06-22 11:52:53 +02:00
Pau Espin Pedrol
74fce9e12d sysmo: l1if_mute_rf: Declare vars inside ifdef section
Otherwise sysp variable is unused and compiler triggers a warn.

Change-Id: Ie3a3529442a36bb885ef634b8b49ac801bd263da
2018-06-22 11:26:34 +02:00
Pau Espin Pedrol
ba3fa11ae2 sysmo: Fix memcmp in RF-MUTE.req for superfemto < 3.6.0
Fixes following compilation warning:
In file included from l1_if.c:32:0:
l1_if.c: In function ‘l1if_mute_rf’:
/include/osmocom/core/utils.h:13:30: error: ‘sizeof’ on array function parameter ‘mute’ will return size of ‘uint8_t * {aka unsigned char *}’ [-Werror=sizeof-array-argument]
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
                              ^
l1_if.c:1405:29: note: in expansion of macro ‘ARRAY_SIZE’
  if (!memcmp(mute, unmuted, ARRAY_SIZE(mute))) {
                             ^~~~~~~~~~
l1_if.c:1388:51: note: declared here
 int l1if_mute_rf(struct femtol1_hdl *hdl, uint8_t mute[8], l1if_compl_cb *cb)
                                                   ^~~~
In file included from l1_if.c:32:0:
/include/osmocom/core/utils.h:13:30: error: ‘sizeof’ on array function parameter ‘mute’ will return size of ‘uint8_t * {aka unsigned char *}’ [-Werror=sizeof-array-argument]
 #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
                              ^
l1_if.c:1408:19: note: in expansion of macro ‘ARRAY_SIZE’
   for (i = 0; i < ARRAY_SIZE(mute); ++i)
                   ^~~~~~~~~~
l1_if.c:1388:51: note: declared here
 int l1if_mute_rf(struct femtol1_hdl *hdl, uint8_t mute[8], l1if_compl_cb *cb)
                                                   ^~~~

Change-Id: Id040aeb35549ddb75072942be0093064a89092a6
2018-06-22 11:26:34 +02:00
Pau Espin Pedrol
5fd4aaaebb sysmo: vty: Add missing include for lchan_deactivate
Fixes following compilation warning:
osmo-bts/src/osmo-bts-sysmo/sysmobts_vty.c:349:3: warning: implicit declaration of function ‘lchan_deactivate’

Change-Id: I1dba0b08fdb2af199f009842c9abf32e25f74be1
2018-06-20 23:08:58 +02:00
Pau Espin Pedrol
63051b96cc l1_if.c: Move decl of vars used in conditional macro
Nowadays, with latest versions of superfemto, those variables are
unused.

Change-Id: Iec6c28840745e1bd99406b777ea5db66ca1d6fd9
2018-06-20 23:06:03 +02:00
Pau Espin Pedrol
31b113774b pcu_sock: Log event pcu_sock created
Change-Id: I2aa55e05ac481fee59af5bad87baf707831df088
2018-06-14 17:54:54 +02:00
Pau Espin Pedrol
d03f311406 lc15: Fix incorrect cast of hLayer1
Change-Id: I545952d0fd4a3fe3ff7c297ce628400b23cfb824
2018-06-11 12:56:30 +02:00
Pau Espin Pedrol
f926d9549c lc15: Use correct type for hLayer1 field
It also fixes a compilation warning in which a uint32_t is assigned to a
void pointer.

Change-Id: I21ea42274eabe854f3b236a22aeb70b93a280541
2018-06-10 19:52:00 +02:00
Pau Espin Pedrol
db330522ea Send DELETE_IND when dropping Imm Assign pending message
This way we give the opportunity to the BSC to release the channel
quicker, otherwise it has to wait until T3101 expires.

Same procedure is already done in rsl.c rsl_rx_imm_ass() when we return
an error (hard limit AGCH queue len reached) from bts_agch_enqueue().

Related: OS#2990
Change-Id: Id9927c0789054ce3ecc7b30380585a1ffe05db5a
2018-06-09 12:02:29 +00:00
Pau Espin Pedrol
868c67fed3 compact AGCH queue: Drop too msg diff than IMM_ASS_REJ
We saw in a recent prod setup a BSC with saturated channels. Further
investigation lead to a AGCH queue of 1000 (previous hard_limit)
messages, most of them being regular IMM ASSIGN (non REJ). Hence, we
also want to get rid of other messages in the AGCH queue (like regular
IMM ASSIGN).

Furthermore, In this scenario, sending IMM ASS REJ is as important as other
messages given than nowadays we support dynamic wait indicatior
(calculated based on chan load), which means if we reach the MS, we can
tell it to wait for a long time to reach us again, which is desirable.

Change-Id: I022b8948da8be13fb8f4bc36e7c9dab11c35fddb
2018-06-08 17:03:06 +02:00
Pau Espin Pedrol
a1a2556c2a bts_agch_enqueue: Decrease queue len hard_limit from 1000 to 100
In a prod setup, complete channel saturation at the bsc was detected,
and Immediate Assignments were not being answered by the MS once sent by
the BTS.
Further investigation showed that the BTS was all the time printing
messages like this:
"bts.c:540 AGCH: too many messages in queue, refusing message type 0x3f, length = 1001/10"

So it seems the AGCH queue was becoming incredibly full (1000, hard
limit triggered the log), while acgch_queue.max_length was set to 10.

As a result, most probably the Immediate Assignments being sent to the
MS are super old in time, and the MS doesn't known about them anymore
once they are receivied, so no answer is sent back.

Let's try to avoid that by decreasing the hard limit so we never reach
that big queue_len scenario.

The number 100 is selected from data gatherered in agch_test.c which
prints a table of max_length values based on different setups. Some
values can reach around 80 messages, so let's use a slightly bigger hard
limit.

Related: SYS#2695
Change-Id: I272798c959abec123776d2fa8dad5685ec512fbd
2018-06-08 17:00:53 +02:00
Pau Espin Pedrol
ef1356c06c bts.c: Add missing include for gsm48_rr_msg_name
It seems I somehow mischecked that the required include for gsm48_rr_msg_name
was not yet present in the file.

Fixes: 44a35902ad
Change-Id: Ia82bc6a5ff7e3989cf0b85ee689d0c3344720eda
2018-06-08 16:28:17 +02:00
Pau Espin Pedrol
44a35902ad bts.c: Log name of RR msg type instead of value
Change-Id: Ia35e132e0b6532dfbf09bb33fe9328a9e3e16885
2018-06-06 19:46:25 +02:00
Philipp Maier
f1e2d08022 rtp: make port range configurable, assign correct port numbers
The current implementation does not allow the user to specify a port
range in which the BTS is allowed to allocate a local RTP port. Also
the ports the BTS picks do not match the policy described in RFC3550.
An RTP Port must be at an even port number and the matching RTCP
port must be at the following (odd) port number. The BTS currently
picks random port numbers for both.

- Add a VTY command to specify a port range in which the BTS may
  assign local ports.

- Pick ports as described in RFC3550.

Change-Id: Id75f1dfaf898ed8750d28b1c4840e188f4cfdc87
Related: OS#2825 OS#2635
2018-05-25 15:41:35 +02:00
Harald Welte
ae3da5f8c3 cosmetic: it's n_r in check_for_first_ciphrd(), not n_s
When we introduced the n_s verification in
2cc37035d7, the variable name n_s was
used for what is actually n_r N(R) read from the LAPDm frame

Change-Id: Iaef1648f35ceae9d7f4cd1d9d5409e05115d199a
2018-05-24 06:08:44 +00:00
Harald Welte
19080d531f scheduler_trx: Add reminders to use libosmocore functions
Let' wait until the just-merged osmo_timerfd_* functions
of Change-Id Ibeffba7c997252c003723bcd5d14122c4ded2fe7 have made it
into the next tagged release, and then replace the implementation
here.

Change-Id: Ic0f0a7437b6acb535177e5ad6ac7a6d336654c66
2018-05-24 06:08:44 +00:00
Stefan Sperling
5a0f85d00b let osmo-bts log a special notice if OML connection is closed early
A frequent configuration file error is that the unit_id settings of
osmo-bts and osmo-bsc don't match. The BSC already prints an error
in this case. Let the BTS print an error as well.

We use a heuristic for this purpose: If the OML link is dropped within
10 seconds after being established, log a special warning which alerts
the user and recommend a manual configuration file check.

Change-Id: I476ac797458b5a46edea3ae9cfbd491fd7f77f47
Related: OS#3143
2018-05-15 20:58:06 +00:00
Pau Espin Pedrol
33da462a2b Bump version: 0.8.0.16-6a9a → 0.8.1
Change-Id: Idee331e94cf00dac4cff29c32453d2bc6780548a
2018-05-15 14:08:47 +02:00
Neels Hofmeyr
6a9a799c9c dyn TS: be less strict on chan_nr, to allow arbitrary pchan switches
To allow switching a dyn TS also between TCH/H <-> TCH/F and anything else,
don't thwart RSL messages just because their chan_nr doesn't reflect the
current pchan mode. For dyn TS, leave that to message handling.

In particular, a TS switch is invoked by a Chan Activ message, in which case
the current pchan by definition mismatches the incoming chan_nr's reflected
channel type.

With this patch, I have tested successful direct TCH/H<->TCH/F switchover on
sysmoBTS, with osmo-bsc patch I72d5d833b186b1e1925d513885b405d8c19aa496 (and
'msc'/'codec-list' vty config to change TCH kinds while gprs mode was none).

Change-Id: I19e5e509101ec91204de9baff04582d99bc8dcb8
2018-05-10 05:16:31 +02:00
Harald Welte
e152fd2614 osmo-bts-trx: Enable A5/3 cipher support
This actually should have been working since 2015, when the following
patch was merged to libosmcore:

commit f8699ca51eeb4f3d34336501abcaf071b4a95a47
Author: Max <max.suraev@fairwaves.co>
Date:   Wed Mar 25 17:20:31 2015 +0100

    gsm: Add A5/3-4 cipher support

however, it seems nobody so far bothered to actually enable A5/3 for
osmo-bts-trx!

Change-Id: I8192d6d07cdb87783bce997456ead673c600f7c0
Closes: OS#3253
2018-05-09 20:34:52 +00:00
Harald Welte
d241f98262 rsl: If CHAN ACT or MODE MODIF fails, send respective NACK
The existign code only sent an ERROR REPORT, but it failed to actually
send a proper NACK to the related request.  This is confusing, as the
operation should always be ACKed or NACKed, and not simply result in no
response.

Change-Id: Ic374a8e5e239ffe37082a54cdb94cb6ac9723e83
Closes: OS#3254
2018-05-09 20:34:44 +00:00
Harald Welte
95d66c2d68 rsl: Properly NACK CHAN_ACKT / MODE_MODIFY
Whenever we encounter an error condition during processing of RSL CHAN
ACT or RSL MODE MODIFY, it's insufficient to simply send an RSL ERROR
INDICATION, but we also must send a proper NACK back to the BSC.

Change-Id: I4dd7ff2fd2cdbc6e892cd329c826ac1bc3b16bb9
2018-05-09 19:16:29 +00:00
Harald Welte
8b70d9f749 rsl: Make channel activation fail if encryption algorithm not supported
The code actually always *wanted* to make lchan activation fail in
case we don't support the algorithm, but it failed ot do so.

The problem is encr_info2lchan() which uses bts_supports_cipher() to
determine if the cipher is supported. However, if bts_supports_cipher()
returns 0 (not supported), it uses this value as return value of
encr_info2lchan() where '0' means success (standard osmocom convention).
This results in channel activation proceeding, which it shouldn't.

Change-Id: I46275b8fc2a1a74f68b4cc60e0f64ba226b108cd
Related: OS#3254
2018-05-09 18:55:59 +00:00
Harald Welte
09e49eed61 rsl: log errors when parsing of encryption information fails
... also log a DEBUG message whenever we change the lchan->encr

Related: OS#3254
Change-Id: Icda7722eef319f343178b0bb8f79362026948199
2018-05-09 18:42:09 +00:00
Neels Hofmeyr
2f54c5f297 add/improve various logging around dyn ts
This logging turned up while I was debugging dynamic timeslots:
- OML Set Channel Attributes logging.
- a specific dyn TS pchan error.
- show pchan and lchan types on CHAN ACT ACK and REL ACK logging.
- on RSL message Rx, log the current pchan kind in detail, using
  gsm_ts_and_pchan_name(). This logs the underlying pchan as well as the
  current pchan mode a dyn TS is in.
- move 2 dyn TS logging from DL1C to DRSL, where all the other dyn ts logging
  is.

Change-Id: Ia89c134060e85f7065afd5642d1c541c65dd25ea
2018-05-08 22:14:54 +02:00
Neels Hofmeyr
ff7eb840ad ip.access dyn ts: properly NACK a PDCH ACT on a still active lchan
Fixes: BTS_Tests.TC_dyn_ipa_pdch_tchf_act_pdch_act_nack
Change-Id: I12816ef9953467decd9f745217135702a544c8fc
2018-05-08 22:14:53 +02:00
Neels Hofmeyr
ba7ed220be fix RSL Chan Activ Nack messages
In early rsl_rx_chan_activ(), do not use rsl_tx_chan_act_acknack() to trigger
sending a NACK, instead use rsl_tx_chan_act_nack() directly.

Rationale: the previously used rsl_tx_chan_act_acknack() may decide to omit the
NACK, particularly based on the lchan->rel_act_kind. lchan->rel_act_kind
indicates whether the Chan Release or Activation was explicitly requested via
RSL, and thus whether an ACK/NACK should go back to RSL or not. This gets set
only late in rsl_rx_chan_activ(). We cannot set it on top, because we need to
first establish whether the Chan Activ is permitted or not. In case of early
rejection of the Chan Activ, we do not want to modify the lchan state, but
merely reply with a NACK, unconditionally.

Before this patch, NACKs that rsl_rx_chan_activ() wants to trigger would
possibly be not be sent out on RSL, because lchan->rel_act_kind is not
explicitly initialized until later.

Fixes: BTS_Tests.TC_dyn_ipa_pdch_act_tchf_act_nack
Change-Id: Ic981f768cc024f0acd3d7ae55846cfbc7bc089ce
2018-05-08 22:14:52 +02:00
Neels Hofmeyr
0958278fb9 ignore RSL RF CHAN REL for inactive lchans
When an RF CHANnel RELease request is received on an already released lchan,
there is no "REL NACK" message or similar, we just ACK the release.

When ACKing the release, make sure to reflect the same chan_nr that the release
was asked for, since the lchan state may actually reflect a different chan_nr.

Factor the actual Rel Ack message sending out of rsl_tx_rf_rel_ack(), which
makes all sorts of decisions around normal Rel Ack: add static tx_rf_rel_ack(),
with chan_nr argument instead of deriving chan_nr from the lchan.

Use this to directly ACK an unusual Chan Rel with the chan_nr that came in with
the request.

Fixes: BTS_Tests.TC_dyn_osmo_pdch_unsol_deact
       (after I6b790e866ce4e66d9385b286b727ae41a83d3e67)

Change-Id: Iceaa2e87874ced42d664a2a0b01a1c59e46a19b3
2018-05-08 22:14:50 +02:00
Stefan Sperling
8799619d27 send a State Changed Event Report when rf is locked/unlocked
Make osmo-bts send a State Changed Event Report when RF is locked
or unlocked. This behaviour isn't mentioned in the spec as far as
we know, but an ipaccess nanobts also produces these messages.

Change-Id: I37e44ef4881c41f8835428b610e7863f37397c9f
Related: OS#3161
2018-05-07 16:44:39 +02:00
Neels Hofmeyr
6bdbf67273 cosmetic: dyn TS: clarify chan_nr composition
In gsm_lchan2chan_nr(), use a switch to reflect both dyn TS kinds and enrich
with comments. Move GSM_PCHAN_TCH_F_PDCH out of gsm_pchan2chan_nr(), which is
now back to pure standard PCHAN values.

Rationale: it's easier to figure out what is going on and why.

Change-Id: I6a31b44220d97c9173c52d3567a1382541710d10
2018-05-05 20:35:58 +02:00
Neels Hofmeyr
c0b7193bae dyn TS: clear TCH state upon reconnecting as PDCH
For ip.access style TCH/F_PDCH, this fixes switch-back to PDCH in case the TCH
use employed encryption.

For Osmocom style TCH/F_TCH/H_PDCH, do the same, purely out of sanity. Roughly
the same should already be happening during PDCH Chan Activ, but make sure to
clear all these fields, so they are cleared even if IEs are missing.

From both dyn TS code paths, call new clear_lchan_for_pdch_activ(), which
clears the same fields that are normally overwritten by an RSL Chan Activ.

Related: OS#3238
Change-Id: I8451039683b54bee910c97c5a3e6873e0ff1b160
2018-05-05 20:35:58 +02:00
Neels Hofmeyr
94b093bffd dyn TS: rx_rf_chan_rel: properly mark PDCH rel when no PCU, clarify
When the PCU is not connected, we immediately call rsl_tx_rf_rel_ack() because
we don't need to wait for a PDCH deactivation. Fix: properly mark rel_act_kind
= LCHAN_REL_ACT_PCU to invoke identical behavior as when the PCU were involved.

(When the PCU is connected, a PDCH release on an Osmocom style dyn TS causes an
actual release of the PDCH TS, and then triggers an rsl_tx_rf_rel_ack() with
rel_act_kind == LCHAN_REL_ACT_PCU.)

Clarify the code flow: rc == 1 is the special case of no PCU being connected,
so have that in a separate if{}.

Change-Id: I654b963815b32fcbce050c2e15f3190c97bc259f
2018-05-05 20:11:03 +02:00
Neels Hofmeyr
ac5e2bc329 dyn TS: fix TCH/F_TCH/H_PDCH: properly record release of PDCH TS
When a release of PDCH is complete, actually set the dyn.pchan_is to NONE.

Failure to do so currently caused errors on activation of an Osmocom style dyn
TS as TCH, in the shape of:

	rsl.c:636 (bts=0,trx=0,ts=2,ss=0) Tx RF CHAN REL ACK
	rsl.c:164 (bts=0,trx=0,ts=2,pchan=TCH/F_TCH/H_PDCH switching PDCH -> NONE) RSL rx DCHAN: mismatching chan_nr=0x12
	rsl.c:2611 Rx RSL CHAN_ACTIV for unknown lchan
	rsl.c:710 0x12: Sending Channel Activated NACK: cause = 0x64

The Tx RF CHAN REL ACK shows that we're through with PDCH release, but the
following line showing "chan=TCH/F_TCH/H_PDCH switching PDCH -> NONE" shows
that the state still reflects active switching.  Thus the DCHAN code decides
that the chan_nr = 0x12 reflecting a TCH/H on TS 2 is a mismatch and NACKs the
TCH activation.

(For ip.access style TCH/F_PDCH, the ts->flags are cleared in
ipacc_dyn_pdch_complete()).

Related: OS#3235
Change-Id: Ic06c8f0fe82ae8a06afa5defd93a685010687965
2018-05-05 20:11:03 +02:00
Neels Hofmeyr
ca262ffa73 cosmetic: dyn TS: clarify rsl_tx_rf_rel_ack() with a switch
Use a switch statement and ample comments to clarify what is done and why.
Cosmetically prepares for Ic06c8f0fe82ae8a06afa5defd93a685010687965.

Related: OS#3235
Change-Id: I8a9953b011a4516972aae468754494f57ebc0a3f
2018-05-05 20:11:00 +02:00
Pau Espin Pedrol
e25d00f10a Bump version: 0.7.0.183-c45a-dirty → 0.8.0
Change-Id: I92b7b584beac870d1dccc9d5637fa54154b6db03
2018-05-03 17:02:19 +02:00
Pau Espin Pedrol
c45a04bf58 scheduler_trx: Fix signed integer overflow in clock calculations
Should fix following observed run time errors:
osmo-bts-trx/scheduler_trx.c:1627:65: runtime error: signed integer overflow: -1081823 * 4615 cannot be represented in type 'int'
osmo-bts-trx/scheduler_trx.c:1627:21: runtime error: signed integer overflow: 1852394502 - -697645849 cannot be represented in type 'int'

Related: OS#3213
Change-Id: I36e0d2d0d0c6e35e963f611135453c4a4c00bc99
2018-04-25 15:00:50 +02:00
Pau Espin Pedrol
c7b206e850 gsm_data_shared.h: Remove unused enum gsm_paging_event
Change-Id: I37c026f0e4d5ed6cbedaa237b259742f44c238b9
2018-04-23 16:56:09 +02:00
Stefan Sperling
4ad781412e return NACK codes instead of errno values from oml_tx_attr_resp()
The caller translates errno values back into NACK codes anyway,
so lets's return NACK codes directly.

Change-Id: I2b1f79e66c778139d64101c89dd6377921807e2d
Related: OS#2295
2018-04-23 08:59:42 +00:00
Stefan Sperling
5a8c0b2b5d cosmetic: fix typos in src/common/oml.c
Change-Id: I6789421497182e957341b01a37a2d9b8d367adf9
Related: OS#2295
2018-04-19 18:44:04 +02:00
Stefan Sperling
12ee1e12b3 respond with NACK for non-hopping BTS with multiple ARFCN
In addition to logging an error, send a NACK if the BSC attempts
to set more than one ARFCN in Radio Carrier Attributes for a BTS
which does not support frequency hopping.

Change-Id: Ia72e23a3f08f825cf9cf0d9a55302d13cfed51d6
Related: OS#2295
2018-04-19 15:46:30 +02:00
Pau Espin Pedrol
71fa788bc8 common/sysinfo.c: Fix no return on on-void function
src/common/sysinfo.c:147:1: warning: control reaches end of non-void function [-Wreturn-type]
 }

The compiler warning is actually a false positive since we call
OSMO_ABORT on that path, but let's add a return anyway so the
compiler doesn't throw a warning.

Change-Id: I9b4e06927489a8bc20ce173279a01415a8c4295a
2018-04-17 19:37:09 +00:00
Pau Espin Pedrol
261b6fdc8f Include missing headers for osmo_init_logging2
Fixes implicit declaration warning messages at compile time.

Change-Id: I753ed49cdcbd1301ba7ea38dcea9113d99fecb06
2018-04-17 19:36:51 +00:00
Philipp Maier
69d0d50677 osmo-bts-trx: perform error concealment for FR frames
When a bad voice frame is received, it is replaced by
a silence frame. This may cause unpleasant audio effects.

This change implements a functionality to craft a replacement
frame from the last known good frame using ECU implementation
from libosmocodec. At the moment, only FR is supported.

Depends: libosmocore I06a21f60db01bfe1c2b838f93866fad1d53fdcd1
Change-Id: Iae9e69a9578ae305bca42f834694af96a29084e6
2018-04-17 16:34:53 +02:00
Philipp Maier
dd4a6518f2 octphy: integrate octasics latest header release
At the moment osmo-bts does not compile with the latest header
file release from OCTSDR-2G-02.10.00-B1837-ALPHA as there are
struct members removed and new ones added. The changes do not
affect actual functionality in the existing code. The only
affected parts are vty functions that query status information
about the clock sync manager.

- Add detection logic in configure.ac to detect if the affected
  struct members are present

- Add conditional compiling to handle the different combinations
  of available struct members.

Change-Id: Ic38d8dc35522205c4ffab583b4e61b5ef03cdba2
Related: SYS#4139
Patch-by: Octasic inc.
2018-04-09 08:29:20 +00:00
Pau Espin Pedrol
e5518b07d6 contrib: jenkins_bts_model: Fix bashism expr
In posix shell, = is valid and == is not.

Change-Id: I5c027039d12c5e455a8f8a0878f88ab30c168db4
2018-04-06 06:44:34 +00:00
Harald Welte
6496edd2e9 fix activation of osmocom-style dynamic PDCH as TCH/F or TCH/H
in change-id Iebd2571726d1284a7431b3f9b23ad3185e832ed1 we introduced
tighter validation on whether the requested channel number matches the
underlying physical channel configuration.  Unfortunately this broke
activation of an osmocom-style dynamic PDCH as TCH/F or TCH/H

rsl_lchan_lookup already permitted a chan_nr if the dynamic PDCH was
already switched to the given TCH mode, or at least the related
switching had already been initiated.

However, in the case of the bug, the current type is NONE, which means
that the compatibility check of rsl_lchan_lookup will fail

Let's relax the checks of rsl_lchan_lookup() slightly to permit
matching for "ts->dyn.pchan_is == GSM_PCHAN_NONE" cases.

This fixes BTS_Tests.TC_dyn_osmo_pdch_tchh_act and
BTS_Tests.TC_dyn_osmo_pdch_tchf_act

Change-Id: I14ae4c4ed2aae0966e5cb5116cf024d6bd890237
Related: OS#3134
2018-04-05 21:44:21 +02:00
Harald Welte
254326de3d rsl_tx_dyn_pdch_ack: Add missing FRAME_NR information element
It seems that the IPA PDCH ACT ACK contains not only the channel number,
but also the frame number.  Let's make sure we're as close as possible
to other implementations to ensure maximum interoperability.

Change-Id: Ibe7988e9ef374e8c7d9429777fb32322d90c2024
2018-04-05 13:50:33 +00:00
Harald Welte
d4c346a931 fox chan_nr_is_dchan() for RSL_CHAN_OSMO_PDCH
When writing chan_nr_is_dchan() in Change-Id: I43a78bec63aeb36dd67043d237b27fe880209349,
I apparently only looked at TS 48.058 without considering the osmocom
extension to it for PDCH activation.  The result is complete breakage
for "osmocom style dynamic PDCH" support.

This patch fixes the mistake by making the compare more specific.

Change-Id: I18e0774fdd48966bc95261e715f798464b8b681f
Related: OS#3131, OS#1853
2018-04-05 13:50:33 +00:00
Neels Hofmeyr
113e30cb06 use osmo_init_logging2() with proper talloc ctx
Completely drop bts_log_init(), call osmo_init_logging2() directly instead: all
callers of bts_log_init() passed NULL as category string, so all it ever did
was call osmo_init_logging(). The bts_log_info is already declared in the .h.

Here and there also define a proper talloc root context instead of using NULL.

Change-Id: Ic049f77bef74123b95350bcae182a468e0086b9c
2018-04-04 17:54:37 +02:00
Keith
091fcf147a osmo-bts-sysmo eeprom.c Restore ability to read/write EEPROM
This commit restores ability to read write to the
SuperFemto EEPROM.

Use offsetof() instead of casts to pointers when
calculating the address to pass to
eeprom_read() and eeprom_write()

Fixes: 7cf144b27d

Change-Id: Iaa7318387ad7bb248c261b1f428019244039e7d2
2018-04-03 11:35:44 +02:00
Philipp Maier
f038b73520 cosmetic: remove unused variable in osmo-bts-omldummy/main.c
Change-Id: I85d8c77589eae511f47b8b9b7439a2c47fe350d8
2018-03-23 17:45:27 +01:00
Philipp Maier
d16b0adef3 cosmetic: remove unused variable
Change-Id: Icbec00ec63950b785dcb71e3b9d70541e70be536
2018-03-23 17:45:27 +01:00
Philipp Maier
ec674ac745 cosmetic: remove dead code
Patch by Octasic inc.

Change-Id: I40ff0b95349308693bec5f4ae56ec7f2f14202e5
2018-03-23 17:44:12 +01:00
Pau Espin Pedrol
5f17e6138e l1sap: Avoid assumption that l1sap is at head of msgb
This assumption used while sending the rx data to gsmtap in l1sap_up was
making osmo-bts-virtual crash, since that bts model is allocating the
l1sap in the stack rather than inside the msgb.
Instead, let's use the assumption that l2h is set correctly in msgb by
the bts model lower layer.

crash report:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff6234ec3 in __memmove_sse2_unaligned_erms () from /usr/lib/libc.so.6
(gdb) bt
0  0x00007ffff6234ec3 in __memmove_sse2_unaligned_erms () from /usr/lib/libc.so.6
1  0x00007ffff6dbf4c8 in gsmtap_makemsg_ex (type=<optimized out>, arfcn=arfcn@entry=17255, ts=ts@entry=6 '\006',
    chan_type=<optimized out>, ss=ss@entry=0 '\000', fn=fn@entry=11249, signal_dbm=0 '\000', snr=0 '\000',
    data=0x5555557d5b50 "", len=4294967263) at libosmocore/src/gsmtap_util.c:179
2  0x00007ffff6dbf6d8 in gsmtap_send_ex (gti=0x555555877f10, type=type@entry=1 '\001', arfcn=arfcn@entry=17255,
    ts=ts@entry=6 '\006', chan_type=<optimized out>, ss=<optimized out>, fn=11249, signal_dbm=0 '\000', snr=0 '\000',
    data=0x5555557d5b50 "", len=4294967263) at libosmocore/src/gsmtap_util.c:311
3  0x00007ffff6dbf765 in gsmtap_send (gti=<optimized out>, arfcn=arfcn@entry=17255, ts=ts@entry=6 '\006',
    chan_type=<optimized out>, ss=<optimized out>, fn=fn@entry=11249, signal_dbm=0 '\000', snr=0 '\000',
    data=0x5555557d5b50 "", len=4294967263) at libosmocore/src/gsmtap_util.c:330
4  0x0000555555573571 in to_gsmtap (trx=0x7ffff7ef8070, l1sap=0x7fffffffde80)
    at osmo-bts/src/common/l1sap.c:397
5  0x0000555555573b9c in l1sap_up (trx=0x7ffff7ef8070, l1sap=l1sap@entry=0x7fffffffde80)
    at osmo-bts/src/common/l1sap.c:1285
6  0x000055555555ec06 in virt_um_rcv_cb (vui=<optimized out>, msg=<optimized out>)
    at osmo-bts/src/osmo-bts-virtual/l1_if.c:170
7  0x000055555555f5c6 in virt_um_fd_cb (ofd=0x55555587cc30, what=<optimized out>)
    at osmo-bts/src/osmo-bts-virtual/virtual_um.c:50
8  0x00007ffff6db6991 in osmo_fd_disp_fds (_eset=0x7fffffffe090, _wset=0x7fffffffe010, _rset=0x7fffffffdf90)
    at libosmocore/src/select.c:216
9  osmo_select_main (polling=polling@entry=0) at libosmocore/src/select.c:256
10 0x0000555555576fbc in bts_main (argc=5, argv=0x7fffffffe288)
    at osmo-bts/src/common/main.c:364
11 0x00007ffff61b5f4a in __libc_start_main () from /usr/lib/libc.so.6
12 0x000055555555c4ca in _start ()

In the old code when the sizeof(osmo_phsap_prim) was being substracted
it resulted on a negative len which later was casted to unsigned int and
became a really big number.

Fixes: OS#3092

Change-Id: I51a880328497673a06d153bfb76c428265b8cbb8
2018-03-21 19:56:10 +01:00
Harald Welte
f397993340 debian: Split osmo-bts-virtual from osmo-bts-trx
osmo-bts-virtual also contains osmo-bts-omldummy

Change-Id: I1c88ed2f7111a6c061ac5721af8f09d9aca4a156
2018-03-17 16:45:37 +01:00
Harald Welte
5b51fe78b4 omldummy: Suppress RSL transmission errors
In omldummy, we don't have a RSL link and hence any transmission
attempts to RSL should silently go to /dev/null rather than printing
error messages via libosmo-abis.  So check for the OMLDUMMY variant and
silently discard any RSL message that the code may want to transmit.

Change-Id: I04a9ec7e416822cc1e45c533e6a66628689615ad
2018-03-17 16:45:37 +01:00
Harald Welte
caeef44699 fix inverted logic bug in omldummy patch
Change-Id: Ic2e7e78f922cb9634217f03482153950c90848a1
2018-03-17 16:40:57 +01:00
Harald Welte
553535f87b Add 'osmo-bts-omldummy' to bring up only OML without RSL
This is used only in integration testing, where in the TTCN-3 testsuite
we currently have no A-bis OML implementation, but only a RSL one.

Change-Id: Id8e5f34091e6e32621d8c8673de7ea848dfd252f
2018-03-17 15:22:51 +01:00
Harald Welte
6d0c67684c virtual: Correctly set+report BTS variant in OML attributes
Change-Id: I76dc47427ec26834859fb737bd319dc379ae8697
2018-03-17 15:14:01 +01:00
Harald Welte
d8cd756da4 Get rid of 'struct gsm_bts_role_bts'
gsm_bts_role_bts was introduced at a time when we still shared
gsm_data_shared.[ch] between BSC and BTS, and where we then subsequently
needed a BTS-private structure.  Since that sharing was abandoned quite
some time ago, we can merge gsm_bts_role_bts into gsm_bts and do away
with the bts/btsb dualism in a lot of the code.

Change-Id: I4fdd601ea873d9697f89a748cc77bcf7c978fa3e
2018-03-17 13:40:03 +01:00
Harald Welte
7c4a22dbc4 cosmetic: Move agch_queue to sub-structure of gsm_bts_role_bts
Rathert han have 11 direct members of gsm_bts_role_bts, group them
into a sub-struct as ew do for other parts like interference, laod, ...

Change-Id: Iefecf4b70c1b11c650913f2ae3783718ffb8a36c
2018-03-17 12:24:29 +01:00
Harald Welte
5cef5056ff gsm_data_shared: Remove unused definitions/members/functions
What we remove here is a legacy from sharing this header file with
openbsc/osmo-bsc-sccplite, which we stopped to do quite some time ago
and hence can remove those parts that are only relevant to the BSC but
not to the BTS.

Change-Id: Icac1656da68f6a006a28c779e3b563bbdd905b3d
2018-03-17 12:24:26 +01:00
Vadim Yanitskiy
fbf0eac21b common/main.c: track talloc NULL contexts by default
In order to be able to introspect not only the root application
context, but also all other contexts, e.g. allocated within
libosmocore or other libraries, let's enable tracking the
use of NULL contexts using the corresponding talloc API.

In order to obserbe all existing contexts,
use the following VTY command:

  OsmoBTS# show talloc-context all ...

Example of usage:

  OsmoBTS# show talloc-context all brief

  talloc report on 'null_context' (total 1302808 bytes in 5185 blocks)
    lapd context              contains    129 bytes in   5 blocks
    struct signal_handler     contains     40 bytes in   1 blocks
    struct pcu_sock_state     contains    120 bytes in   1 blocks
    struct lookup_helper      contains     24 bytes in   1 blocks
    struct signal_handler     contains     40 bytes in   1 blocks
    struct signal_handler     contains     40 bytes in   1 blocks
    abis                      contains  49065 bytes in  19 blocks
    struct signal_handler     contains     40 bytes in   1 blocks
    struct signal_handler     contains     40 bytes in   1 blocks
    struct signal_handler     contains     40 bytes in   1 blocks
    vty                       contains  93690 bytes in 5008 blocks
    logging                   contains   2862 bytes in   7 blocks
    OsmoBTS context           contains 1156678 bytes in 137 blocks

Change-Id: I5e9381902dace7dfd37f98b657e4697b5afcff96
2018-03-13 21:16:37 +07:00
Neels Hofmeyr
5b8889ce6b configure: add --enable-werror
Provide a sane means of adding the -Werror compiler flag.

Currently, some of our jenkins.sh add -Werror by passing 'CFLAGS="-Werror"',
but that actually *overwrites* all the other CFLAGS we might want to have set.

Maintain these exceptions from -Werror:
a) deprecation (allow upstream to mark deprecation without breaking builds);
b) "#warning" pragmas (allow to remind ourselves of errors without breaking
   builds)

As a last configure step before generating the output files, print the complete
CFLAGS and CPPFLAGS by means of AC_MSG_RESULT.

Change-Id: I5b37602a117350159183fb53ac330294b94f4195
2018-03-13 00:01:47 +00:00
Harald Welte
7d648b4657 sysinfo: Fix scheduling of downlink SACCH information
The existing algorithm (present since 2012!) failed to work
in the sole case that only *one* SACCH filling type was present.

So if you had your BTS configured to only broadcast SI5, but not
broadcast SI5ter, SI6 or any other SACCH filling, it would send
the SI5 message only once on a newly-established channel, and never
again.

The old code was working for more-than-one SACCH filling, as well
as for no SACCH filling at all.

Let's also add a NOTICE message if there is no SACCH filling available
at all.  This is highly unusual and definitely a noticeable event.

Change-Id: Ica801f9b9c118f00d9e3dc2780b3123e925f59b4
Closes: OS#3057
Related: OS#2963
2018-03-11 21:23:49 +01:00
Harald Welte
f72bdfaaa9 cosmetic: Document some SI scheduling related function API
Change-Id: I7e61639349deda28846810c4f52dbea78dccda38
2018-03-11 21:23:49 +01:00
Neels Hofmeyr
02d1fe87f0 implement support for 3-digit MNC with leading zeros
Record the mnc_3_digits flag from SI and pass on via the PCU interface.

Instead of changing to e.g. osmo_plmn_id, add the flag separately, and instead
of bool use a uint8_t, to not raise any struct packing issues and clarify the
flag's size beyond any doubt.

Bump the PCU interface version to 9.
This is one part of the three identical pcuif_proto.h patches:
- I49cd762c3c9d7ee6a82451bdf3ffa2a060767947 (osmo-bts)
- I787fed84a7b613158a5618dd5cffafe4e4927234 (osmo-pcu)
- I78f30aef7aa224b2e9db54c3a844d8f520b3aee0 (osmo-bsc)

Depends: Id2240f7f518494c9df6c8bda52c0d5092f90f221 (libosmocore)
Change-Id: I49cd762c3c9d7ee6a82451bdf3ffa2a060767947
2018-03-11 00:45:49 +01:00
Harald Welte
29cd7a8408 sysmobts: Compatibility with older firmware versions
When using a firmware version < 3.6, the call to l1if_mute_rf()
returned an error, which caused an OML CHG ADM STATE NACK.

Let's check if the l1if_mute_rf() call is an un-mute for all
timeslots (which apparently we do always at start-up).  If it is, then
acknowledge it even if muting is not supported by earlier firmwares.

I suppose the change causing this problem was introduced in:
	commit b26b8fc776
	Author: Holger Hans Peter Freyther <zecke@selfish.org>
	Date:   Tue Mar 4 15:03:59 2014 +0100
    	sysmobts: Do a RF mute at initialization when the RC is locked

With the current change applied, we can run the BTS with earlier
firmware versions than 3.6.0 again.  Tested with 3.1 and 2.4

Change-Id: I1a29c1031d96e65a0111bc812a90f2dbaf2a5aa3
2018-03-10 11:01:10 +00:00
Harald Welte
58a95ac799 sysinfo.c: SI1 is optional; Send SI2 at TC=0 if no SI1 exists
SI1 is only required if frequency hopping is used or if NCH is used. So it's optional.

If OsmoBTS has no SI1 configured, it will transmit the empty SI1 buffer
at TC=0, and as a result no valid SI will be broadcast at TC=0.

Change-Id: I41ab885c00e943199b2e939e98f30e267ecffbee
Closes: OS#3051
2018-03-09 22:16:44 +01:00
Neels Hofmeyr
c2045474b1 fix handover: handle_ph_ra_ind(): evaluate ra_ind before msgb_trim()
Commit c2b4c668f3
I3b989580cb38082e3fd8fc50a11fedda13991092 introduces evaluation of ra_ind
members below the msgb_trim() call that actually invalidates ra_ind.
A symptom is that it breaks detection of Handover RACH, wich always ends up
with lchan == NULL and interpreting all RACH as chan_nr == 0x88.

Fix: do all evaluation of ra_ind before the msgb_trim(), for osmo-bts-sysmo,
litecell-15 and octphy.

To guard against similar mistakes in the future, set ra_ind = NULL before the
msgb_trim() call.

Related: OS#3045
Change-Id: I203021ee57f49cb963679ba8bec5943e2abb67fb
2018-03-08 21:18:34 +01:00
Vadim Yanitskiy
7eed026efc common/vty.c: remove unused variables
Change-Id: I289dda64228e81ca4c608121e50146a71e19f1e2
2018-03-06 16:14:12 +07:00
Philipp Maier
4e959b2aa0 l1_tch: remove dead code
the file l1_tch.c in the octphy spcific code has its root in the
tch.c file of sysmobts. It contains some sysmobts specific ifdefs
which enclose dead code.

- Remove the sysmobts specif ifdefs and the dead code

Change-Id: I33f3e0fd293ca8387fddf5ed20f642621e9680de
2018-03-05 17:38:09 +00:00
Vadim Yanitskiy
1ef544ea24 common/l1sap.c: limit the minimal ToA for RACH bursts
In general, RACH bursts should not arrive with negative offset.
Let's limit early signal arrival up to 2 symbols, otherwise it
is most likely noise, interference or a ghost.

TTCN-3 test case: Icccc88545ed3aabd6da28a40599a8a77d1de477d
Change-Id: I662294fe3136cf7a259be13816a3e63f7db9a948
2018-03-05 22:44:08 +07:00
Vadim Yanitskiy
4f14804f8a common/l1sap.c: perform noise / ghost filtering for handover RACH
For some reason, the noise / ghost filtering was performed for
normal RACH requests, but not for handover RACH requests. There
are also ghost RACH, interference and noise possible, so let's
extend the filtering coverage.

Change-Id: I94fc15835280d624780200dadc4418210bf565ff
2018-03-05 20:43:02 +07:00
Vadim Yanitskiy
0dfe137009 common/l1sap.c: clean up noise / ghost RACH filtering
It makes sense to combine both existing BER (Bit Error Rate) and
ToA (Timing of Arrival) checks into a separate funcition, so
this code may be also used for handover RACH.

Change-Id: I1ddda238d5212a88a3dd5c4fc5dfcfea018151bd
2018-03-05 20:29:47 +07:00
Vadim Yanitskiy
53bdf4d949 common/l1sap.c: increment valid RACH counter after all checks
Previously, the number of RACH slots with valid non-handover RACH
burst was incremented between both BER (Bit Error Rate) and ToA
(Timing of Arrival) checks. So, if a RACH burst passed the BER
check, but was dropped by ToA check, the counter of valid RACH
requests could be increased anyway.

Change-Id: I31594a8c5dce1f42226ced5b2dc8778152b3d829
2018-03-05 20:03:06 +07:00
Vadim Yanitskiy
10aa1cd6f6 common/l1sap.c: increase the BTS_CTR_RACH_DROP in RACH BER check
The BTS_CTR_RACH_DROP counter is being increased in case if a RACH
request is ignored due to exceeding ToA value, but remains untouched
in case of exceeding BER (Bit Error Rate). Let's fix this.

Change-Id: Ia02e781d6c47d9d8012a4c8846fe4b731aab74d7
2018-03-05 19:40:55 +07:00
Vadim Yanitskiy
8a28868b29 scheduler_trx.c: remove ToA (Time of Arrival) hack
This was useful for software simulation of burst delay, expressed
by ToA (Time of Arrival). Since we have FakeTRX toolkit, ToA value
may be simulated in a more flexible way, so let's remove this code.

Change-Id: Ied0fcfcf58b93efdc6de9666fbbf8fea104e2543
2018-03-05 05:54:32 +07:00
Philipp Maier
2f052f33de rsl: remove unused variable
The variable btsb in rsl_rx_mode_modif() is set but not used.

- remove btsb

Change-Id: Ic07edfa04c2184bff4a043e96e69c07df38607e4
2018-03-03 08:57:20 +00:00
Philipp Maier
16929dc75c ipac: fix log output
The current log output logs connect_ip connect_port
speech mode and payload type over multiple lines and without
logging context (lchan name). Also the logging level
incorrectly set.

- shrink log output into one line.
- add context (lchan name)
- encode ip/port into human readable form

Change-Id: I61044edc0672b268aeebf48b59a772887703399f
Closes: OS#3001
2018-03-03 08:56:58 +00:00
Alexander Couzens
4046e3b3dd pcuif_proto: add version 8 features
Add PCU_IF_MSG_DATA_CNF_DT and PCU_IF_SAPI_AGCH_DT to bring the
pccif_proto into sync. Both commands are required to support the
rb11 with an osmo-bsc co-located pcu.

Change-Id: I6d330aca26249ee94ece5e415079f0b75c6e8b48
2018-03-02 14:52:17 +01:00
Alexander Couzens
f03a3a584c pcu_if: move definition PCU_SOCK_DEFAULT into pcuif_proto.h
PCU_SOCK_DEFAULT is defined in the pcu counterpart of the file pcuif_proto.h
To be consistent with the pcu move the definition pcuif_proto.h
The pcuif_proto.h will be exact the same in the pcu repo and bts repo.

Change-Id: I67f8ec036e219994cc296d0ed5409da7f3ec681e
2018-03-02 08:57:37 +00:00
Vadim Yanitskiy
94a74e1b1c common/pcu_sock.c: fix double field assignment
The 'data_ind->rssi' variable is assigned values twice.

Change-Id: I81eb1ac3dc2aa3597b1c85301b92995412edbc7b
2018-03-02 01:38:22 +07:00
Philipp Maier
80dddfd90d octphy: replace #warning with #pragma message
warning causes the compiler to throw an actual warning. Lets
change those intentional warnings to messages.

Change-Id: I2fc83a1a07db9c569b93f29835bf3a0fd8ef4ef5
2018-03-01 16:12:48 +01:00
Harald Welte
cb0a076728 pcu_sock: LOG + drop PCU DATA.req for inactive lchan
Change-Id: I11c622967885d594ef7e1c24b9bafd0fb8fd400c
2018-02-28 22:06:56 +01:00
Harald Welte
d5988d27e9 pcu_sock: LOG + drop DATA.req from PCU for non-PDCH timeslot
Change-Id: I3ae496eca96bc0823dfeca16ce36c200ce000895
2018-02-28 22:06:56 +01:00
Harald Welte
0be8200455 pcu_sock: Log an error message and discard PCU primitives for BTS != 0
In OsmoBTS, we (so far?) only have a single BTS inside each process,
let's make sure we log an error message if the PCU should ever want to
transmit primitives to a non-zero BTS number.

Change-Id: I158f935fed12941737c806c0677a8192ea3418a0
2018-02-28 20:22:41 +00:00
Harald Welte
bae7af9c13 pcu_sock: Don't overflow the timeslot array
Don't blindly trust that the ts_nr received on the PCU socket will be
small enough to not overflow our timeslot array!

Change-Id: Ie9964c8dc0ca7b049da7dfec0ac0a0d3f1aedd45
2018-02-28 19:08:55 +01:00
Harald Welte
70a0ee56f7 pcu_sock: Discard messages that are too short
The downstream code of pcu_sock.c doesn't contain any length checks,
so let's discard any messages that are shorter than the primitive
length.

Change-Id: I35ac84d4db6d21ea61afbd1864c810bbf601d69b
2018-02-28 19:08:55 +01:00
Alexander Couzens
e1ff92b8dd pcuif_proto: correct indention of gsm_pcu_if_data
Change-Id: I39f3bc1f0a1e238f8f00cb00e2d1e5193f118c16
2018-02-28 09:43:49 +00:00
Harald Welte
5bd6132c04 Add high-accuracy ToA value to Uplink Measurement Reports
Normal Abis RSL MEasurement Results contain only the "MS Timing Offset
IE" in units of full symbols.  In some use cases it is important to have
higher-accuracy timing information exposed to the BSC.

We do this by adding the average timing offset value during the last
measurement interval in 1/256th symbol accuracy to the "Supplementary
MEasuremen Information" part of the TS 48.058 9.3.25 Uplink Measurements
IE.

In order to avoid any compatibility issues, this feature is only enabled
if the new vty config command "supp-meas-info toa256" at the bts node
is enabled.

Change-Id: Ie85e53b47d4041cc4e6d7b78406ae8b79b2d9397
2018-02-27 20:00:16 +01:00
Harald Welte
916d508bf6 measurement: Keep average of high-accurate ToA value in lchan
At the end of a measurement processing window, we currently compute
the ToA / timing offset at 1/256th symbol accuracy, but we only print
it to the log.  Let's store the value in the lchan to make it usable
by other code in follow-up patches.

Change-Id: I5f00a16ac966b627d9452a98b8fa70984bed684a
2018-02-27 20:00:16 +01: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
c092f4e1de measurement.c: higher-precision TA/TOA math
Change-Id: I0dc8e78545465dfc5c93691a49b86b6b8b56b432
2018-02-27 19:59:00 +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
b3a2a3e24f RACH decoding: Use BER threshold for RACH ghost detection
When decoding RACH bursts, we should use a BER threshold in order to
help distinguish 'ghost' RACH bursts from real RACH bursts.

The theoretical ideal threshold according to some papers is 7 out of 41
bits qhich aquals to Eb/N0 of 0 dB = 0.1707 (17.07%)

We add a new 'ber10k' parameter to the RACH indication l1sap primitive
(needs separate change for libosmocore), and then fill this value from
osmo-bts-{sysmo,lc15,trx,octphy}.  The common part above L1SAP then
applies the threshold, which can be changed from vty using the
	"max-ber10k-rach <0-10000>"
command available at the BTS node.  The unit is BER in 1/10000, i.e. a
value of 100 equals 1% bit error rate.

Change-Id: Ic41c11f6312a36baa2738547e8dcec80829457f8
2018-02-27 17:27:46 +01:00
Harald Welte
c2b4c668f3 Move rach_busy counting above L1SAP
In the past, rach_busy counting was performed below L1SAP, while
reporting was handled above.  This lead to subtle differences between
the BTS models, such as osmo-bts-trx missing to increment rach_busy.

Let's move the rach_busy counting above L1SAP to share more code.

This means we need libosmocore Change-Id
I9439810c3a3ad89ea0302753617b850749af887c for the additional required
parameters in ph_rach_ind_param, as well as libosmocore Change-id
I2b1926a37bde860dcfeb0d613eb55a71271928c5 for osmo-bts-trx to determine
the RACH bit error rate.

Change-Id: I3b989580cb38082e3fd8fc50a11fedda13991092
Closes: OS#3003
2018-02-27 17:27:35 +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
0d6c3e8110 measurement.c: Don't silently copy "FULL" measurements to "SUB"
The existing code contained an ugly hack that if we didn't have any
"SUB" measurements we would simply use the "FULL" values.  That's wrong
as TS 45.008 contains quite detailed rules on how the "SUB" values are
to be computed.  In some cases, they are identical to "FULL", but in
most they are not.

Let's remove the hack and replace it with an ERROR message, as clearly
something is wrong if we ever encounter a measurement period end in
which no single "SUB" measurement was received.  The only situation in
which this can occur is if the related uplink burst/block was missing,
so let's set BER to 100% and level to lowest possible.

Change-Id: I358f7b97fd4ea19264a77eff7abef13da7d5fbcd
2018-02-26 15:01:08 +01:00
Harald Welte
3a80a56b9b measurement: Compute RX{LEV,QUAL}-SUB for SDCCH and non-AMR TCH
The rules on how to compute RX{LEV,QUAL}-SUB are rather convoluted, and
depend on the detailed channel type and mode.

For SDCCH and TCH/H in signalling mode, it's easy: No DTX is allowed,
and all measurements are used in SUB.

For non-AMR (TCH/F and TCH/H in non-signalling mode), we need to count
the SACCH block measurements, as well as any
SID/SID_UPDATE/L3_FILL/DUMMY blocks received in the blocks of table
8.3 of TS 45.008.

Only AMR (TCH/AFS + TCH/AHS) are more difficult, as there are no fixed
blocks/bursts/frames that always contain uplink messages, but the L1
will have to determine if a valid SID_UPDATE was received or not.

This patch implements the above rules (except AMR related) in the common
part of OsmoBTS.  The AMR specific bits will have to follow as a later
patch, likely in a BTS specific way, i.e. separate changes to
sysmo/lc15/octphy/trx code.

Related: OS#2978
Change-Id: I16eb3747a1c23df935a4c50dafe46abce512a474
2018-02-26 15:01:08 +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
bcc20a871c {sysmo,lc15}: Fix RACH reporting in combined CBCH case
Combined CCCH with CBCH is a separate PCHAN type and hence we must
accept it in the list of RACH-carrying pchan types in order to correctly
report the RACH chan_nr when handing RACH requests up to L1SAP.

The bug this fixes likely might have rendered cells with combined CBCH
impossible to use.

Change-Id: I9537463e5eedd2b8b30f298e0d3b308367c5b1fb
2018-02-26 13:48:11 +01:00
Harald Welte
591c8993e9 {sysmo,lc15}: Correctly report BER to L1SAP in INFO_MEAS_IND
L1SAP uses 'ber10k' values, i.e. BER in 1/10000 units, where 10000
is all errors are bit-errors (= 100%).

The PHY on osmo-bts-sysmo and osmo-bts-lc15 is reporting a float fBer
value scaled to 1, i.e. 1.00 = 100% and hence must be 10000 as ber10k.

Before this patch, BER values reported on those BTS models were too
low by a factor of 100, resulting in way too optimistic RxQual values
reported to the BSC.

Closes: OS#3005
Change-Id: I17e2f8fe8055f613da1e554cd36ed13289f56fb3
2018-02-26 13:48:11 +01:00
Harald Welte
f100992a20 octphy: Remove code duplication for BER / RSSI conversion
Let's introduce some functions to hide the details of BER and RSSI
conversion from OCTPHY representation to L1SAP representation.

Change-Id: I517669c87a97b2ba164a2812811c8802fe0b92e8
2018-02-26 13:48:11 +01:00
Harald Welte
49a8969bd6 counters: split rach:sent into rach:drop, rach:ho, rach:cs and rach:ps
Change-Id: I51e9938df0e05b8fdb12686b9a9bb6994546deed
2018-02-26 13:48:11 +01:00
Harald Welte
de3b4a248e measurement.c: Fix sdcch4_meas_rep_fn102 / sdcch8_meas_rep_fn102
Since Change-Id: I23fba50f48415314da40cf5bf86fce2ed3e66af6 we were not
reporting measurements for SDCCH channel types due to the wrong
encoding of the sdcch{4,8}_meas_rep_fn102 table.

Let's fix the table by encoding the needed information:

 "What is the modulo-102 remainder of the first burst of the last block
  before fn%102 reaches 37?" (SDCCH/4)

 "What is the modulo-102 remainder of the first burst of the last block
  before fn%102 reaches 12?" (SDCCH/8)

The TS 45.002 Clause 7 tables have to be consulted carefully to
determine this information.

Change-Id: Icf02354872670126ab3297b787b216981ca6c309
Related: OS#2965
2018-02-26 12:33:19 +00:00
Harald Welte
989f779cfc RSL IPA DLCX: Avoid another null-pointer dereference
In case a DLCX _with conn-id_ is issued without any CRCX before,
we ran into a NULL pointer dereference in adding the connection
statistics.  Let's handle this gracefully and simply return empty
statistics.

Change-Id: If8b71266c847b90cdc51695b9f47b527c51bd70c
Closes: OS#2996
2018-02-25 12:52:44 +01:00
Harald Welte
9c4ea743fd RSL: Fix encoding of ConnectionID in IPA_DLCX_ACK
Change-Id: Ifdea747e78f191902870af53692f7a70fa7ece93
Closes: OS#2999
2018-02-25 12:52:44 +01:00
Harald Welte
756bfca599 RSL IPA DLCX: Avoid null-pointer dereference
In case a DLCX is issued without any CRCX before, let's handle this
gracefully and simply ack the DLCX anyway.

Change-Id: I7c5bedccfc5a7cf552a9ce3a2dc712081c7ce177
Closes: OS#2996
2018-02-25 02:01:49 +01:00
Harald Welte
681be20a8c paging: Fix encoding of PAGING TYPE 3 Rest Octets
The RR PAGING TYPE 3 Rest Octets IE contains (among other things) the
channel type needed for Mobile Identity 3 + 4 in the paging message.

We did not only "forget" to encode those channel type needed field, but
we have a completely wrong definition of those rest octets in
libosmocore/include/gsm/protocol/gsm04_08.h "struct gsm48_paging3"

Change-Id: I3a0bca6707ce95b68459c89f5b2b07f1590a1ab3
Closes: OS#2994
2018-02-25 00:01:15 +01:00
Harald Welte
42c50727b5 rsl: Improve ERROR REPORTing
Let's make sure all useful optional IEs of the RSL ERROR REPort aare present

Change-Id: I5ecb98f8c72f472ac23c1e4e0f606b75e2cf032c
2018-02-24 19:26:42 +01:00
Harald Welte
d3875a8fcb paging.c: Fix encoding of optional Mobile ID RR PAGING TYPE 1 / 2
It seems we have been encoding PAGING REQUEST TYPE 1 and
PAGING REQUEST TYPE 2 erroneously all the time.  The optional last
Mobile Identity in those messages are TLV, not just LV.

This is a quite serious bug in one of the most fundamental parts of
the Radio Resource layer, and it has likely stayed hidden for a long
time as usually in small networks there's a low paging load, reducing
the amount of pressure to put multiple identities in one PAGING REQUEST
message.

Change-Id: Icc320ed130d0c29e9260a6a2aabe52e7346c3888
Closes: OS#2993
2018-02-24 19:26:42 +01:00
Harald Welte
84de287da0 paging: Drop + Log paging requests for non-existant paging groups
Change-Id: Id02c8fea51c1260f1baae8566c67bafc5bdb970e
Related: OS#2992
2018-02-24 19:26:42 +01:00
Harald Welte
d7f8a1c16e BTS: add rate_ctr about CCCH (paging, agch, pch)
Change-Id: Id6c833746150a3c2e32b00ea6604669f16b84bc4
2018-02-24 19:26:42 +01:00
Harald Welte
c113501513 RSL: Send ERROR REPORT on too short/truncated messages + wrong discriminator
Change-Id: I6a0e63999f39592474064e2f05df450aec8e37fe
2018-02-24 04:35:49 +01:00
Harald Welte
19da7fdea8 RSL: Implement DELETE INDICATION on AGCH overflow
This patch adds generation of a DELETE INDICATION when the BTS AGCH
queue overflows due to too many IMMEDIATE ASSIGN CMDs, as required
by the specs.

The AGCH queue length in OsmoBTS so far is at 1000 entries, which I
consider way too high.  But that is for another patch.

Change-Id: Ied3306e85cbdc6f3476b10dc4bb0463cd728b274
Related: OS#2990
2018-02-24 04:35:49 +01:00
Harald Welte
6e92255cc7 load_indication: Fix start of load indication timer
Starting the timer in bts_init() may result in it expiring already
before the load indication period is set via OML.   Let's make
load_timer_start() safe to call several times and call it from OML
code.

Change-Id: I295d91413542014aa2507d5f09e01243fc3916fa
Fixes: OS#2991
2018-02-24 04:14:03 +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
815ff00d23 osmo-bts-trx: Add missing frame number to l1if_process_meas_res()
Change-Id: I7f1322b025ce733f78ae2b958c7a2bb38b6aa6f5
2018-02-23 19:58:29 +01:00
Harald Welte
aa9ce821a0 l1sap: Pass is_sub from L1 primitive into the Uplink Measurement
info_meas_ind on the L1SAP always allowed the lower layers to pass
in whether a given measurement is part of the "SUB", or not.

However, the existing l1sap code before this patch simply drops this
information, despite the measurement.c code also having "is_sub" state.

Let's make sure this state is passed from L1SAP into measurement
processing as intended.

Fact is, none of our current lower-layers actually set this is_sub flag
for their primitives passed up in L1SAP, but at least now *if* they
would set that flag, the measurement code would process it as intended.

Related: OS#2978
Change-Id: Ibed2e8d7563b471c6b5dd2214ac4765caf31ed2a
2018-02-23 19:57:52 +01:00
Harald Welte
1effad1004 measurement.c: Hand Frame Number into measurement computation
This is currently only used for logging, but will be needed for proper
RX{LEV,QUAL}-SUB reporting in upcoming patches.

Related: OS#2978
Change-Id: I07fd06e8a379cab7c0c2eb111c3f5600037d3c9e
2018-02-23 19:57:44 +01:00
Harald Welte
2de8f6c7ec Revert "measurement: fix measurement computation"
This reverts commit d5fdcfe6d9, which
introduces a new function lchan_meas_update_ordered_TA whose
functionality I still haven't yet managed to fully understand. It
appears to be adjusting the requested timing advance (lchan->rqd_ta) but
outside osmo-bts-trx/loops.c code. This is odd, as rqd_ta is a state
variable of that loops.c code.

So for one part, it is a failure of encapsulation. The TA loop code
should be self-contained, particularly as it is only used for
omso-bts-trx, and not for the other BTS models. The new
lchan_meas_update_ordered_TA() function is used from common code,
applicable to all BTS models.

The resulting interaction between loops.c code and this new (now
reverted) function cause the TA value to only ever grow, despite the MS
never moving at all.

Change-Id: I5a5adac6f18f94a5b51758a5ace8ef6ddfd23e80
Related: OS#2989
2018-02-23 19:57:20 +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
232f53adf0 osmo-bts-virtual: Make sure PRIM_INFO_MEAS have non-zero frame number
Measurement reports fed into L1SAP so far had their frame number always
set to zero, resulting in higher-layer common code above L1SAP to never
detect the end of the measurement period, which in turn caused no RSL
MEAS REP to be sent.

Related: OS#2978
Change-Id: I67837d19515ea335614928570c12dd5027104c6b
2018-02-23 14:05:51 +00:00
Harald Welte
ac0254c000 osmo-bts-virtual: Make use of LOGL1S() macro for context
In Change-Id I5703b46c8a59fe00a3cdc063bcf72872980ec5e5 we introduced
LOGL1S and starte to use in in common/scheduler.c as well as
osmo-bts-trx but somehow we didn't introduce it in osmo-bts-virtual
at the time.  Let's catch up.

Change-Id: I0b5fd3b7982b9119becda844531108f64c68d19f
2018-02-22 12:31:51 +01:00
Harald Welte
6eb3752511 Introduce + use LOG/DEBUGP with frame number prefixing/printing
Let's make sure whenever we do have a frame number, we print it as
context in the related log line

Change-Id: I751d5ddb3322fce489bc241459738cbcc55c890b
2018-02-22 12:31:48 +01:00
Harald Welte
22c07d1f1f osmo-bts-virtual: Generate PRIM_INFO_MEAS (with bogus values)
The problem is that measurement processing above L1SAP requires/expects
those PRIM_INFO_MEAS indications from the bts specific parts.  Otherwise
it will never generate even uplink-only measurement reports to the BSC,
which is a violation of Abis protocol specs.

Change-Id: I48f73293cb4f0ab4c657dfd00e7ddd032a3c030f
2018-02-22 12:11:28 +01:00
Harald Welte
04719d19b9 osmo-bts-virtual: Shut down gracefully on socket creation failure
Don't simply crash if creation of the multicast socket fails

Change-Id: Ie87b6684b3aa7f21742e4cf21533e980485c1230
2018-02-22 12:11:28 +01:00
Philipp Maier
a4bca11555 bts: use feature list instead of speech codec table
osmo-bts has a table of pchan/channel mode combinations for every
bts. This table models the codec capabilitys of the BTS hardware.
However, having the speech codec apabilities modeled inside the
BTS feature list would be much more comfortable and since the
feature list is communicated back to the BSC we would get the
codec capabilities inside the BSC domain as well.

- remove the pchan/channel mode tables
- set speech codec variants for each BTS type
- fix bts_supports_cm so that it queries the feature list

Change-Id: I977dc729ba856631245aedf76afd48eac92166f7
2018-02-22 07:58:26 +00:00
Philipp Maier
b93748a170 vty: display bts features in vty command show bts
The VTY command show bts does not display the bts specific
features yet.

- Also display the feature list in snow-bts

Change-Id: I509f2a7bbfa96c70bdfea4ff2488ee371e914620
2018-02-22 07:58:26 +00:00
Philipp Maier
bfe9af4ae1 octphy: ensure all BTS models set features
Most of the BTS models do not or do register not all of thier
features to the the feature list.

- Update/extend the feature lists for all BTS-Models

Change-Id: I26765a64153368016921c2ac115b1c4aec9bc5e4
2018-02-22 07:58:26 +00:00
Philipp Maier
e0bfd675d1 gsm_data_shared: extend bts feature list with speech codecs
The feature list does not cover any speech codec related information.

- Add speech codec related items to feature list.

Change-Id: If6d50c6f4e2348b23f31c3415b0f5577a3f5be50
2018-02-22 07:58:25 +00:00
Harald Welte
4847a1688b RSL: Ensure we don't accept DCHAN messages for CCHAN
If the Channel Number IE points to a common channel, we cannot
accept such messages in code paths that only process dedicated
channels, such as RLL/DCHAN/IPA.

Related: OS#2972, OS#2971
Change-Id: I43a78bec63aeb36dd67043d237b27fe880209349
2018-02-21 16:49:28 +01:00
Harald Welte
5e60186bec RSL: Properly reject RSL CHAN_NR IE for incompatible PCHAN
If we receive a message for a dedicated channel, whose channel number
structure doesn't match with the physical channel (timeslot) type,
we must properly reject this.  For RSL CHAN ACT it means sending a NACK,
and for all other cases it means sending an RSL ERROR REPORT.

Related: OS#2972, OS#2971
Change-Id: Iebd2571726d1284a7431b3f9b23ad3185e832ed1
2018-02-21 16:48:46 +01:00
Harald Welte
df72b1fdbd trx: make l1if_fill_meas_res() static
it's not used anywhere outside of l1_if.c, so make it a static function

Change-Id: If988a7679f3a9253fab1a4d177a276d8ecaf794f
2018-02-19 14:34:01 +01:00
Harald Welte
0829a1704e sysmo+lc15: Add missign include for readv/writev
This avoids compiler warnings like this:

../../src/osmo-bts-sysmo/l1_transp_hw.c:130:13: warning: implicit declaration of function ‘writev’; did you mean ‘write’? [-Wimplicit-function-declaration]
   written = writev(fd->fd, iov, count);

Change-Id: Ic67d369a3ca33bfa636ace9f272f1c7257de86e1
2018-02-19 14:33:46 +01:00
Harald Welte
7cf144b27d sysmo: Fix compiler warnings in eeprom.c
This avoids compiler warnings like

../../src/osmo-bts-sysmo/eeprom.c: In function ‘eeprom_WriteSysInfo’:
../../src/osmo-bts-sysmo/eeprom.c:605:58: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
             err = eeprom_write( EEPROM_CFG_START_ADDR + ((uint32_t)&ee.cfg.v1.sysInfo - (uint32_t)&ee), sizeof(ee.cfg.v1.sysInfo), (const char *) &ee.cfg.v1.sysInfo );

Change-Id: Ic748038e6f25ec18ccb4a2f2503ca567fb00a586
2018-02-19 14:33:40 +01:00
Stefan Sperling
ca6021fa5d Cosmetic fixes for power ramping code.
Fix typos in 2 comments.

Change-Id: I214bcc8b78446bfea450fe445fa9391898638905
2018-02-19 08:51:25 +00:00
Philipp Maier
bf1fea0928 rsl: do not allow MODE MODIFY request with unsupp. codec/rate
When the BSC sends a MODE MODIFY request with an unsupported
codec, the BTS must respond with a negative acknowledge.
Currently the codec parameter is not checked at all, which may
lead into malfunction or crash of the BTS.

- Introduce a mechanism to check the codec/rate against a
  table that is set up in the phy specific code.

- Add tables with supported codec/rate combinations for
  octphy, sysmobts, and trx.

Change-Id: Id9b222b7ab19ece90591718bc562b3a8c5e02023
Related: SYS#3212
2018-02-19 08:38:21 +00:00
Harald Welte
efa55a4541 osmo-bts: Add talloc context introspection via VTY
This requires libosmocore with Change-Id
I43fc42880b22294d83c565ae600ac65e4f38b30d or later.

Change-Id: Ieed87b8109e0095a3d99c30f0b042aa3ee4b6384
2018-02-14 00:45:57 +01:00
Pau Espin Pedrol
54be46949e l1sap: Validate incoming RTP payload, drop bw-efficient AMR
A recurrent kernel crash in sysmobts (several kernel versions)
corrupting kernel memory in random places has been investigated and
reproduced by placing a call against an MSC sending RTP
with bandwidth-efficient AMR payload to osmo-bts-sysmo.
The osmo-bts-sysmo in turn sends the payload to the femtobts related
kernel modules via a msgq, which most probably fail to handle correctly
this bw-efficient AMR payload and corrupt the kernel memory.

First approach was to drop the bw-efficient AMR payloads lower in the
stack in sysmo specific code (l1if_tch_encode), but as there's no bts
model in osmo-bts actually supporting bw-efficient AMR, let's drop it
early in the incoming path for all models to avoid further problems.

Related: SYS#4063

Change-Id: If0c9233c628c724de4ab74e58e3e2affac79e6d0
2018-02-09 13:15:51 +01:00
Pau Espin Pedrol
98f3f70079 main.c: bts_main: fix typo in error message
Change-Id: Ib44fce36a945042e92ea3f4173e72c1ce5f66fb8
2018-02-08 17:15:01 +00:00
Max
9955cc4306 osmo-bts-trx: ignore frame offset error on startup
Previously we always printed error on startup:
l1sap.c:461 Invalid condition detected: Frame difference is 627202-0=627202 > 1!

This is expected and of little practical use. Let's suppress it
by checking that FN was actually initialized.

Change-Id: I4f7cf285e437db0e980e1a2a3ab48a7255945448
2018-02-08 16:50:20 +01:00
Max
c2e3ff58bc osmo-bts-trx: init nbits to know value
It seems like some of the functions invoked by _sched_dl_burst()
do not sent nbits properly. This leads to a number of errors on
startup:

trx_if.c:593 Tx burst length 65535 invalid

It happens in conjunction with:

Transceiver.cpp:382:pushRadioVector: dumping STALE burst in TRX->USRP interface

Let's fix this by initializing nbits to 0 to make sure those bursts
are properly ignored.

Change-Id: Iaf85826861163c185925de528c8347ab22779e30
2018-02-08 16:42:48 +01:00
Max
322cfc4942 Add helper to get BCC from BSIC
Change-Id: Ib539a8739d53ab60d8fadffcef38152b82a28498
Related: OS#1854
2018-02-07 20:45:22 +01:00
Harald Welte
aa0f964ce2 vty: don't print "Bound IP / Port" if it isn't bound [yet]
Change-Id: I28705b56582d334d568d98a371daa6bb9ef1f625
2018-02-05 23:18:56 +01:00
Harald Welte
50cc22a30c Print much more information during 'show lchan'
This adds printing of remote RTP IP/Port, LAPDm SAPI information,
MS Timing offset, propagation delay, encryption algorithm+state,
loopback status and radio link failure counter to the "show lchan"
command.  It also adds TODO comments fro those bits that are not yet
printed but which would make sense to print.

Change-Id: Ic4bc47638b7b402aee9344dc912745a9929c37f4
2018-02-05 23:18:53 +01:00
Harald Welte
845e995b5a Add 'show (bts|trx|ts|lchan)' commands
This is more or less a 1:1 import from the BSC side commands.  Having
the commands on the BTS side will allow us to expose information that's
not visible to the BSC [in upcoming, separate patches].

Change-Id: I2a596938849a9c84fe6fedcac5d7f71ee97af575
2018-02-05 21:29:57 +01:00
Harald Welte
40ec238762 gsm_lchan: remove unused member fields
Change-Id: Icfc601e664ccf33078955e54b02315085cff20a8
2018-02-05 21:29:57 +01:00
Pau Espin Pedrol
f9d19ee85c virtual: l1_if.c: Remove unneeded warning message
Commit 5eb17e28ac added this warning when
implementing the full function. However, other backends seem to be also
passing the primitive from the stack to l1sap_up without any visible issues.
Furthermore, according to the documentation of l1sap_up, it takes ownership of the
msgb, but doesn't take ownserhip of the prim itself.

Change-Id: I45fe40e3377eac999d1dac5356678195381d94ca
2018-02-05 12:36:41 +01:00
Pau Espin Pedrol
1948aeb269 vty.c: Remove warning message
This warning was included in commit
6d7b78bde1 from 2011, and nowadays I only
see this command used in osmo-bts, so I think we most probably drop it
as it doesn't make sense anymore.

Change-Id: Ie277dce00292c8f403b9a2b405efe4429e6af86a
2018-02-05 12:36:41 +01:00
Pau Espin Pedrol
6dcbe4836a octphy: octpkt.c: Remove unused static functions
Change-Id: I97c08b66d41ab5902a11a1e989e278c56cdee102
2018-02-05 12:36:41 +01:00
Pau Espin Pedrol
bbb23cfc5b l1sap.c: l1sap_tch_rts_ind: Remove unused variables
Commit a1fa955212 added them without
really making use of them.

Change-Id: Ie7cd648a4b8a5ae59efc8953d6424a91a0f025ef
2018-02-05 12:36:41 +01:00
Pau Espin Pedrol
61da9b3d2c bts-trx: scheduler_trx.c: Fix missing header
It is required for bts_shutdown used in trx_fn_timer_cb, and compiler
warns about implicit declaration.

Change-Id: I274662cd657ce8c36ed1d262d138590808bfafea
2018-02-05 12:36:41 +01:00
Pau Espin Pedrol
131db780cc Remove unused variables
Change-Id: I3fec7e4b337f3ea4d8cd79f4e7261babc34911cb
2018-02-05 12:36:28 +01:00
Pau Espin Pedrol
5cef0623ef gsm_pchan2chan_nr: move warning to pragma message and track issue
Take the chance to move the default option to the end as it's the
usually expected syntax.

Change-Id: I21298fcd0d1c1aafdd3dc1e8c8dae37b271b1d3d
2018-02-01 18:57:03 +01:00
Philipp Maier
40c05f07f4 fix nullpointer deref in rsl_tx_mode_modif_nack()
The function rsl_tx_mode_modif_nack() uses abis_bts_rsl_sendmsg().
This function relys on msg->trx to be set (see abis.c). However,
rsl_tx_mode_modif_nack() creates the message buffer, but does
not set msg->trx.

- Make sure that msg->trx is set properly

Change-Id: Ib5990db11df1b25dc5d321193731426b11f8005a
2018-01-26 12:42:10 +01:00
Philipp Maier
7d62629ca2 rsl: fix double-free in rsl_rx_mode_modif()
When the RSL_IE_CHAN_MODE is is missing, then the message buffer
is freed and the channel mode modify is nacked using
return rsl_tx_mode_modif_nack()

The function rsl_tx_mode_modif_nack uses abis_bts_rsl_sendmsg()
which returns 0 on success. This eventually leads into a double-
free in rsl_rx_dchan() which frees the message buffer on all
return codes except 1.

- Remove the excess msgb_free() in the error handling path.

Change-Id: I946a927ba35aa115520b1248eefccd91832f69f6
2018-01-26 12:42:04 +01:00
Alexander Huemer
75d0fcdfcd gitignore: add missing entries
Change-Id: I509e564a82b6632c0cdf052526e9f7f3397155ce
2018-01-25 01:48:55 +01:00
Alexander Huemer
0e176264f4 various Makefile.am: add missing CFLAGS
Change-Id: I0717aaaf062a7c3c8b35520fa837b51fd6aed47f
2018-01-25 01:44:51 +01:00
Alexander Huemer
d6d4b50911 cosmetic: Makefile.am whitespace
Change-Id: I480fbf85912de2ea3518a906b9edf23b1485e936
2018-01-25 01:39:06 +01:00
Max
5675afa6b9 Enable sanitize for CI tests
Change-Id: I3e2e1fb777a7cbf74e2f7c4288ed5f3277c7faed
2018-01-24 12:36:45 +00:00
Max
cedad415fc CI: drop unused OsmoPCU dependency
The independent copy of pcuif_proto.h file is used by OsmoBTS so we
don't have to checkout OsmoPCU to obtain it.

Change-Id: If8d7330adf3edc44c3b49b1f6e854cce0eca2d8e
2018-01-24 13:27:24 +01:00
Max
e5b613d29b sysmobts: move header check to appropriate place
Move the header check specific to sysmoBTS 2050 next to generic sysmoBTS
header check.

Change-Id: I165c373b58146658a5a69a2d7222d60cff4db79a
2018-01-22 11:24:44 +01:00
Max
2d1f53439b sysmobts: remove weird default header location
The sysmoBTS-specific headers were never looked for in the current
directory. None of the CI tests use it as well. None of the other BTS
models use such defaults. Let's just drop this to restore expected
header location semantics.

Change-Id: I0b2906e284e1e22a960c4f0f1f38724de009eda5
2018-01-21 23:34:34 +01:00
Max
71506d70d7 Move -I inside *INCDIR variable
Previouslywe could end-up passing empty '-I' to compilerif corresponding
_INCDIR variable was not defined during the ./configure step. This is
apparently tolerated by gcc but still seems like a wrong thingto
do. Let's fix this by moving -I inside of *_INCDIR.

Change-Id: I80915e5756d1bf64d789cfd5341fdd417ca8eed9
2018-01-21 23:16:17 +01:00
Max
d11e8cf341 sysmobts: use proper includes for sbts2050 test
When testing for sbts2050_header.h during ./configure stage, use proper
include path defined earlier.

Change-Id: I55e50f612ab2a082b34096d71359dd08da150cf1
2018-01-21 23:16:10 +01:00
Max
f5a810d6f7 Remove unneeded LIBOSMOCORE_CFLAGS from tests
When testing for the presence of particular BTS model-specific header
during ./configure step, we don't need to add LIBOSMOCORE_CFLAGS because
none of those headers use it for compilation. Moreover, adding it might
hide the problem if the headers under check are available in the same
location where libosmocore headers were checked out.

Change-Id: I64bf1acb9db999567e8a2a6690cfc96d6e4b7ee1
2018-01-21 22:50:10 +01:00
Pau Espin Pedrol
e95ad79d6c bts-trx: Detect duplicated responses for retransmitted commands
It was detected that under some conditions, osmo-trx (with limesdr)
may take a long time to answer to CMDs, which means trx_ctrl_timer will
trigger re-transmitting the last sent but yet unacked CMD. Due to the
high latency in osmo-trx, the original AND the rentrasnmited CMD are
handled after a while and RSP messages are sent for both. When
osmo-bts-trx receives the first RSP, it was marking the CMD as acked and
carried on with next one. Then, when the RSP from the retransmited CMD
arrives, it already lost state and doesn't know where does that come
from. As a result, osmo-bts-trx shutdowns.

The issue can be seen in the following truncated log from osmo-bts-trx
with TRX category enabled:
20180117135228175 Enqueuing TRX control command 'CMD RXTUNE 1782000'
20180117135228175 Enqueuing TRX control command 'CMD TXTUNE 1877000'
20180117135228175 Enqueuing TRX control command 'CMD SETTSC 7'
20180117135228175 Enqueuing TRX control command 'CMD POWERON'
20180117135228175 Enqueuing TRX control command 'CMD SETRXGAIN 1'
20180117135228175 Enqueuing TRX control command 'CMD SETPOWER 20'
20180117135228175 Enqueuing TRX control command 'CMD SETSLOT 0 5'
...
20180117135249829 Response message: 'RSP POWEROFF 0'
20180117135249855 Response message: 'RSP RXTUNE 0 1782000'
20180117135249876 Response message: 'RSP TXTUNE 0 1877000'
20180117135249876 Response message: 'RSP SETTSC 0 7'
20180117135250648 Response message: 'RSP POWERON 0'
20180117135251150 Response message: 'RSP SETRXGAIN 0 0'
20180117135253151 No response from transceiver for phy0.0 (CMD SETPOWER 20)
20180117135253777 Response message: 'RSP SETPOWER 0 20'
20180117135254535 Clock indication: fn=2018878
20180117135255777 No response from transceiver for phy0.0 (CMD SETSLOT 0 5)
...
20180117135256858 Response message: 'RSP SETPOWER 0 20'
20180117135256858 Discarding duplicated RSP from old CMD 'RSP SETPOWER 0 20'
20180117135256858 Response message: 'RSP SETSLOT 0 0 5'
20180117135256858 Response message: 'RSP SETSLOT 0 0 5'
20180117135256858 Discarding duplicated RSP from old CMD 'RSP SETSLOT 0 0 5'

Change-Id: I3633cba212edde878f83ed36aef922aaca6f503a
2018-01-19 15:41:19 +01:00
Pau Espin Pedrol
8c1d157643 bts-trx: trx_if.c: Improve parsing of received RSP messages from TRX
First the cached CMD sent (struct trx_ctrl_msg) is reworked to have the
cmdname and the params in different buffers for easier comparison with
RSP later.

For the receive path (trx_ctrl_read_cb), new function helpers are added
to parse the buffer into cmdname+params+code (parse_rsp) and to compare
if a given RSP matches the current CMD we sent (cmd_matches_rsp).

The reasoning behind this patch is that a way to check for parameters
when receiving a RSP will be needed in future work, as before this patch
checking of parameters is ignored. This commit is a preparation for commit
to check for duplicated responses.

Change-Id: I2474cbc3e4457cf04f78e1c168768295e1132034
2018-01-19 15:41:19 +01:00
Pau Espin Pedrol
1f80e9815f bts-trx: trx_if.c: trx_ctrl_read_cb: Move error handling to end of func
The move includes a small logic change: If there's a mismatch between
the rsp and the cmd, now we bts_shutdown instead of blindly skipping
expected RSP and continuing with sending the next CMD in the queue. The
change is specially not a problem since next patches are improving the
logic furthermore to account for duplicates, different parameters, etc.

Change-Id: I7018ded23fe51f364f248ade111aaa80ef46187e
2018-01-19 15:41:19 +01:00
Pau Espin Pedrol
9a57c7bed4 bts-trx: trx_if.c: Log timedout+retransmitted CMD
Change-Id: Ib573c86a1640640c2a61e80fe1f1412b30342b1a
2018-01-19 15:41:19 +01:00
Max
63948b033d Enable optional static builds
The default (for both manual and .deb builds) is to use shared build (as
before) - the static build is entirely optional.

Change-Id: Iabdebefef5c07dd1cd4b94b29ca40c6be0f8adda
2018-01-19 14:32:32 +00:00
Neels Hofmeyr
f37fcc9c7b fix build: tests/sysmobts: add missing -I$(SYSMOBTS_INCDIR)
Change-Id: I5427d614c6301b897ad32adbecd98ce5ebec6f66
2018-01-19 15:24:09 +01:00
Max
e91723a967 fix build: tests/misc: missing libosmo-abis and -trau flags
Add missing LIBOSMOABIS_CFLAGS and LIBOSMOTRAU_CFLAGS.
Pair the _LIBS below the _CFLAGS in LDADD above (cosmetic).

Fixes the stow-enabled jenkins builds are currently failing like below:

In file included from ../../include/osmo-bts/gsm_data.h:136:0,
                 from ../../include/osmo-bts/bts.h:4,
                 from misc_test.c:23:
../../include/osmo-bts/gsm_data_shared.h:21:35: fatal error: osmocom/abis/e1_input.h: No such file or directory
 #include <osmocom/abis/e1_input.h>

Change-Id: I94ea8bad8b410550f72ee6a0408f42f6bd8b6cac
2018-01-19 15:22:57 +01:00
Max
e81347f216 Allow specifying sysmocom headers explicitly
Add configure option --with-sysmobts=$INCDIR (like for LC1.5).

Use to fix the jenkins build to fix the build after migration to stow, where we
can no longer use a commin -I to include the sysmobts headers as well.

Tweaked-by: neels
Change-Id: I0416a9f4c428189cd9c3909c8bd016ca2908128a
2018-01-19 15:06:15 +01:00
Neels Hofmeyr
d1f0a7e927 jenkins_common.sh: fix build_bts distcheck for more than one conf_flag
Passing configure flags in DISTCHECK_CONFIGURE_FLAGS requires enclosing all
flags in quotes. Currently we seem to have no callers with more than one
configure flag, so we were lucky not to break there.

Change-Id: I37bc517a30d00c744eddc8565a0a8181cb3b2cdb
2018-01-18 00:18:57 +01:00
Max
bef6eae05b Move sysmobts-calib into osmo-bts-sysmo
It's prerequisite for jenkins tests fix after migration to stow. The
sysmobts-calib uses hand-coded Makefile instead of automake which makes
it hard to properly propagate build flags. Also, make it optional to
enable excluding it from certain jenkins tests.

Change-Id: I3b54bfa5ef1d89092f6cf13dc27de10874b31b18
2018-01-16 15:53:00 +01:00
Philipp Maier
5df57cb84c meas_test: fix header file references
The unittest module meas_test.c contains a lot of unused header
files as the result of a cut and paste error made earlier. Also
the reference to stdio.h is missing.

remove all header file references that are not needed.

add missing header reference to stdio.h

Change-Id: I167be096ed25a86b1114de1ada955822a0b42856
2018-01-10 11:10:28 +00:00
Pau Espin Pedrol
ef8cdfbacb oml.c: Fix use of htons instead of ntohs
In oml_ipa_mo_set_attr_cell, as well as we do in other set functions in
the same file, we want to store a parsed value from a TLV received on
the network into a host local structure. We hence need to use ntohs
instead of htons.

Change-Id: Icbf65f8a4b871b0fa2e84ad6cd2188d4e34f704b
2018-01-08 15:45:49 +00:00
Max
f28b660666 Print FN delta on L1 errors
Change-Id: Ieb99c970eafb25b504c2b85221fb12d5a3c39789
2018-01-08 13:48:01 +01:00
Max
1adfc52a72 Remove BSC-specific parts
The dead code is from before repo-split time.

Change-Id: I9d4ee8d55a4096bf47407c7d2bdbf3063bf1666e
2018-01-05 10:06:44 +00:00
Max
667b0f1fe5 Use existing function to obtain TSC
Change-Id: I209f26b527a41b3b6f8e405f2a21b3d4bc4746fb
2018-01-04 11:47:33 +01:00
Max
a11d8e95ee Add --enable-sanitize configure option
Change-Id: I4e31e20ef2361c8f251f3ab04a0ac86e23d2e8a1
2017-12-21 17:29:53 +01:00
Philipp Maier
0bac3efc17 octphy: l1_oml: check returncode of trx_by_l1h()
The function trx_by_l1h() is used to fetch the pointer to a an
osmo_bts_trx from a list. The ID that is used to reference the
transceiver comes from the incoming message. If the firmware
sends odd identifiers (firmware bugs, damaged packets) the
transceiver can not be found in the list and a nullpointer is
returned, which then leads into a nullpointer derefernece
problem.

Check the returncode, and depending on the situation either
return with -EINVAL or exit osmo-bts immediately.

Change-Id: I04ef3b4896e1322c2a6d29ea86a88994c7748bf7
2017-12-20 15:54:25 +01:00
Pau Espin Pedrol
3c96db29fa jenkins.sh: Disable building doxygen for deps
Change-Id: I2ed207a5febe8017a20a0e7de0ba575fd7966af6
2017-12-14 16:02:29 +01:00
Pau Espin Pedrol
035fc9a134 debian/control: Remove uneeded dep libosmo-netif-dev
I didn't see any related libosmo-netif code dependency in the project.

Change-Id: I2da1935bcc3ce507cfb21419a1e340aa3361cd65
2017-12-14 16:01:13 +01:00
Philipp Maier
8f12047157 cosmetic: tests/agch: remove unused var "static_ilv"
remove unused const variable "static_ilv" from unit test "agch"

Change-Id: Ie724e2e5875020aa835b4cd57ab96966aee283e1
2017-12-11 12:57:17 +00:00
Philipp Maier
4a43618332 cosmetic: tests/power: remove unused var "ret"
remove unused variable "ret" in unit test "power"

Change-Id: Ied484e3e2d3006eb0f03516ceaed3e0e802d51e4
2017-12-11 12:57:17 +00:00
Pau Espin Pedrol
4848c2c445 Fix malformed Resource Indication packet
Wireshark was showing a Malformed packet alert, and further
ivnestigation showed that "Resource Information" TLV was missing in the
packet. See GSM 08.58 sections 8.6.1 and 9.3.21 for more information.

Indicating interference level is not yet implemented, but at least now
we avoid sending a malformed packet.

Patch has been validated against a running setup with wireshark in my local PC.

Related: OS#2735

Change-Id: Ie97170811aaf8a089febfa20380ab48ea174056a
2017-12-11 13:28:34 +01:00
Philipp Maier
33942ed156 cosmetic: tests/Makefile.am: remove excess whitespace
Change-Id: I7090d46ae72183014e6c74d6ddb240af8d66e0b4
2017-12-10 22:12:35 +01:00
Pau Espin Pedrol
4b4c2ec4b3 bts-trx: Avoid enqueueing consecutive duplicate messages to TRX
While debugging other protocol/timing issues between osmobts-trx and osmo-trx,
I found that sometimes two consecutives "POWER OFF" commands are
enqueued and sent to osmo-trx.
There's no point in doing so, as the write queue already maintains state
and retries the command until a RSP is received, then goes for the next
one.

With this change we hence improve timing response as we don't need to
wait for the second command to be processed, and on top we get cleaner
logs and simplified states which are easier to debug.

Change-Id: Ib6a5e7bfac8bc5e1b372da6a1f801c07a3d5ebb7
2017-12-10 14:05:57 +00:00
Pau Espin Pedrol
62b575db67 bts-trx: trx_ctrl_cmd: Simplify var assignment logic
Change-Id: I9250e3003cff24035440bbba3e1171650dc83209
2017-12-10 14:05:36 +00:00
Philipp Maier
28cb32a74b cosmetic: meas_test: fix section comment
Change-Id: Id228620ccf5a40c8089ae1914d59b19e808ea151
2017-12-07 12:59:17 +00:00
Max
6f9d76e66c Log filenames on L1 errors
Change-Id: I7e73374f3f1da662ebed52548d29b6b76443c81b
2017-12-05 16:40:36 +00:00
Harald Welte
5b70bb673d DTX: avoid illegal character contained in DTX FSM allocation which causes BTS crash
Problem:

 lchan->tch.dtx.dl_amr_fsm struct failed to allocate in l1sap_chan_act routine
 in l1sap.c due to illegal characters contained in lchan->name which are passed to
 osmo_fsm_inst_alloc routine. As a result, lchan->tch.dtx.dl_amr_fsm is NULL
 causing BTS crashed (SEG FAULT) when trying to access this struct.

 Below is snapshot of crash log obtained by GDB:
 ...
 Fri Nov 24 18:13:55 2017 <0000> rsl.c:1653 payload type: 98
 Fri Nov 24 18:13:55 2017 <0000> rsl.c:1463 (bts=0,trx=0,ts=2,ss=0)
 RSL Tx IPAC_MDCX_ACK (local 127.0.0.1:11538, remote 127.0.0.1:30012)
 Program received signal SIGSEGV, Segmentation fault.
 0x00031930 in dtx_dl_amr_fsm_step (lchan=lchan@entry=0xb69592a8,
 rtp_pl=rtp_pl@entry=0x87ae8 " \024\351Y\363_\337\345\351f\177\373\300\210\201\200\210",
    rtp_pl_len=17, fn=1728481, l1_payload=0x10dd25 "", marker=marker@entry=true,
    len=len@entry=0x10ddc4 "\024", ft_out=0xbefff7d7 "\002",
    ft_out@entry=0xbefff7cf "\276\341_\032") at msg_utils.c:233
 233     msg_utils.c: No such file or directory.
 ...

Fix:
* Use different formatting for lchan name passed to osmo_fsm_inst_alloc routine
* Refuse channel activation if FSM could not be generated (as opposed to crash)

Related: OS#2606
Reported-by: Minh-Quang Nguyen <minh-quang.nguyen@nutaq.com>
Change-Id: I929ce3703dc57acf8db569ae0e346265644d0b3c
2017-12-05 14:54:59 +00:00
Harald Welte
70c4dc8d70 osmo-bts-trx: Fix reported frame number during PRIM_INFO_MEAS
The upper layers (L1SAP, the common part of L1) *always* require frame
numbers in the uplink direction to be reported as the frame number of
the *first* burst, not the last burst of a given block.

This is particularly important in the case of passing up measurement
information, as we use this frame number to detect if the measurement
interval for that specific timeslot has just ended (and hence we must
process the measurements and send an uplink measurement report to the
BSC.

Before this patch, the measurement results were reported with the *last*
frame number, which caused the common/measurement.c code never detect
the end of a measurement window.

On TS2, tons of the following log messages were observed:
<0004> measurement.c:199 (bts=0,trx=0,ts=2,ss=0) no space for uplink measurement, num_ul_meas=104

With this patch, it behves as expected:  the measurements of 25 blocks
(= 100 bursts) are aggregated, after which point the report is computed
and sent.  Subsequently, num_ul_meas is reset to 0 and the cycle
restarts.

Related: OS#2329
Change-Id: I1065ae9c400bb5240a63ab8213aee59aeb9ceeff
2017-12-04 13:25:34 +00:00
Harald Welte
be4a208809 Put useful information in RTCP SDES.
The RTCP Sender Description is supposed to contain useful information
to identify the source of the RTP stream.  So far, it only contained
compile-time default data of libortp.  Let's put the BTS UnitID, the
lchan number and the OsmoBTS version in there.

This change requires libosmo-abis Change-Id Ice794f9e0c6caeea1c67520c12efbfa375d1fb82

Change-Id: Id6ce7188354d3a0517661c9648854ec829ef1cac
Related: OS#2701
2017-12-03 21:22:25 +00:00
Harald Welte
5112c45d22 rsl.c: Log RTP socket related errors as DRTP, not DRSL
The respective errors/events occur as a result of calling osmo_rtp_*
API, and are clearly more fitting into the DRTP category than the DRSL,
even though the respective actions are triggered by RSL.

Change-Id: I52e6f9865492a2f757a37860eb92a3dc49e174ef
2017-12-03 21:13:24 +00:00
Harald Welte
a7bfb6c8da osmo-bts-octphy: Remove bogus warning about BS_AG_BLKS_RES
Contrary to osmo-bts-sysmo, the OCTPHY-2G does not have different L1
SAPI for AGCH and PCH.  It uses cOCTVC1_GSM_SAPI_ENUM_PCH_AGCH for both,
and we convert that to the cbits=0x12 (Downlink CCCH) on the L1SAP.

The code above L1SAP can hence freely decide if it wants to respond with
an AGCH or PCH message, based on its knowledge of BS_AG_BLKS_RES,
without the OCTPHY specific code having to do anything about it.

Hence, there's nothing to do, and the warning can be removed

Change-Id: Ic1038b8dc57bdaf05493cd8479355b960275ea41
Related: OS#1575
2017-12-03 10:01:54 +00:00
Harald Welte
57ce53d8aa measurment.c: Introduce INFO category for DMEAS logging
There's no point in either having full verbosity in DEBUG level
and not logging any measurement related information in INFO.  Let's
at least print the results at the end of each measurement period in INFO
level.

Change-Id: I2c870531478c05ce31cc1015597a068a4a76cf99
2017-12-02 21:06:06 +00:00
Harald Welte
6b264c5344 l1sap: Fix log subsystem: Use DRTP for RTP related bits, L1C for MPH
Change-Id: Icc0325f41a1d80535d33e123083e220ee47df129
2017-12-02 21:05:34 +01:00
Harald Welte
cbcd3c5034 scheduler_trx: L1P is for PH (data), L1M for MPH (control)
Almost all log statements in scheduler_trx.c were using the wrong
logging subsystem.  Let's fix this.  Also, make it more obvious from
the log subsystem help text

Change-Id: I4312f8ab0414eb38db0d62f05c95ab961f500c14
2017-12-02 21:05:34 +01: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
41d471351f Comments on individual members of struct gsm_abis_mo
Change-Id: I8e005410080201746906b8a60e9f7957031d2e58
2017-12-02 21:05:34 +01:00
Harald Welte
478f2f7696 measurement.c: Fix various typos in comments
Change-Id: Ief208045664769406cd60a92a12c4b44988a98b4
2017-12-02 21:05:34 +01:00
Vadim Yanitskiy
536ebeed08 doc/examples: add CalypsoBTS configuration example
Despite the CalypsoBTS transceiver is similar to OsmoTRX, there
are some changes required to make it work with OsmoBTS. Let's
add a new configuration example for that.

Change-Id: Ia4b1797de576ab987b05046aa9a9828858023ed3
2017-11-27 22:59:20 +00:00
Max
f78caac25c Remove leftover comments and checks
It seems like rx previously had 'float' type. Remove the comments and
checks which are not relevant since rx is 'int'.

Change-Id: Idb4aad53667f88f9656c5bb1c52e7e75b385f446
Fixes: OS#2223
2017-11-27 16:17:16 +01:00
Pau Espin Pedrol
2564756296 l1sap: Fix abort on big RTP packet received
Recently while testing new osmo-mgw, big RTP packets (around 4K bytes,
see OS#2625 for more info), were being received on the BTS, which was
aborting with the following message:
"msgb(0xff208): Not enough tailroom msgb_put (348 < 1488)"

The crash can be reproduced in a sysmobts as well as on my PC locally
with osmo-bts-trx. I used osmo-bts-trx to test that the patch solved the
abort.

Fixes: OS#2624

Change-Id: Idfde1dacc3dc3d3d5e239cf1f7e39ade7fc25975
2017-11-08 16:45:01 +01:00
Philipp Maier
80117acba6 octphy: override firmware version check
When osmo-bts detects a mismatch between the firmware of the DSP
and the header version which it was compile with, a hard exit
is performed. In some cases this may hinder debugging/testing things.

Implement a commandline option to intentinally override the check.

Change-Id: I5774fbb29da832786326afb991014b9bd8b04b59
2017-11-08 04:43:55 +00:00
Harald Welte
14566e3ced l1sap: fix wrong return value of is_fill_frame()
When determining if a frame is a fill frame or not, the case
statement only conditionally handled AGCH and PCH cases.  In
case a non-fill-frame was observed, the return value was uninitialized,
resulting in some non-fill-frames to be missed from GMSTAP

Change-Id: I7b46c720e34cb8ef9a91ae5da28a050439a1937d
Closes: Coverity CID#174175
2017-11-06 03:46:24 +09:00
Harald Welte
bb8037b7eb trx: Don't assume phy_instance_by_num() returns non-NULL
In trx_clk_read_cb(), when calling phy_instance_by_num(), that
function might in error cases return a NULL phy-instance. Let's
put an OSMO_ASSERT() there as safeguard to avoid NULL dereference
when dereferencing pinst->trx->bts.

Fixes: Coverity CID#178657
Change-Id: If6b6b45380368e9ee9e03ca1eb7ac56c21e72b03
2017-11-06 03:00:08 +09:00
Harald Welte
8e202b595c trx: Don't call osmo_fr_check_sid with negative 'rc'
In rx_tchf_fn(), if gsm0503_tch_fr_decode() returns a negative
result, we cannot use that result as length argument to
osmo_fr_check_sid()

Change-Id: Ic4080b5bf6c865be3333f923f19a2340e1e272c8
Fixes: Coverity CID#178659
2017-11-06 02:56:41 +09:00
Harald Welte
d8d402099f trx: Avoid NULL+1 dereference in trx_ctrl_read_cb()
We unconditionally pass "p+1" into sscanf() despite not knowing
if 'p' is NULL or not.

Change-Id: I40a49c3feb3b55ef577eebd7d567afdbcfe0d624
Fixes: Coverity CID#178661
2017-11-06 02:54:36 +09:00
Harald Welte
6733906f62 trx: Better be safe than sorry before calling strlen
There's a lot of pointer arithmetic in trx_ctrl_read_cb which is
not so nice.  While I believe the current code is safe, Coverity
raises "CID 178665:  Insecure data handling  (INTEGER_OVERFLOW)"
regardin the use of rsp_len in the strcmp().

Let's put some OSMO_ASSERT() in front and hope that makes Coverity
happy.

Change-Id: I5a9b3307f83cdde7c8e9f66932446604f5623b05
2017-11-06 02:50:21 +09:00
Pau Espin Pedrol
a73177b190 lc15: Fix cfg indentation
I was unable to start osmo-bts-lc15 with this config file until this
change was made, it said this command didn't exist.

Change-Id: Iae80e2ed504b5e26d748d57be7558ce470555f97
2017-11-01 12:06:35 +00:00
Neels Hofmeyr
b1f5c71da6 vty: skip installing cmds now always installed by default
vty_install_default() and install_default() will soon be deprecated.

Depends: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b
Change-Id: I5e8e9d7989ee20fe722bdd3109965d5bce9519fb
2017-11-01 00:49:19 +01:00
Harald Welte
a5ed03fe5c Tag/Release 0.7.0
This marks a new release that's compatible with libosmocore >= 0.10.0,
and which no longer depends on openbsc-dev.

Change-Id: I67405cb5f0f4dea85c67febfdef80f49ae1d41a6
2017-10-28 20:54:17 +02:00
Harald Welte
6bf97927f1 configure.ac: Fix Mailing list address
We've had openbsc.org ages ago but have moved everything to osmocom.org
at some point in 2010/2011.  This should have been updated back then

Change-Id: I5da8e9fba8f15719414fa81e2a6211f906329c2e
2017-10-28 20:52:58 +02:00
Neels Hofmeyr
a39dab4b7c jenkins: use osmo-clean-workspace.sh before and after build
See osmo-ci change I2409b2928b4d7ebbd6c005097d4ad7337307dd93 for rationale.

Depends: I2409b2928b4d7ebbd6c005097d4ad7337307dd93
Change-Id: I830b17462b636e0bf03f4d88000660409503c3e5
2017-10-28 15:08:36 +00:00
Harald Welte
2757cbc2a8 update dependencies to latest libosmo-*
We can either try to really build with those old versions or find the
minimum version, or we can simply require latest version of all
libosmo*, which is the safeest choice for now.

Change-Id: I08915540b92d5135b0c325e30b5b6e24f88e6282
2017-10-27 22:53:43 +02:00
Harald Welte
9982b95069 Fix Downlink AMR FSM name to avoid illegal space character
Since libosmocore Change-Id I9ef59432f43a3cdb94e4cbb0c44ac3f9b2aac0f2
we enforce that FSM names do not contain illegal characteers such as
spaces.  Let's change the DL TX FSM for AMR to comply to this.  Also,
actually do check the result of the FSM registration.

Change-Id: Ieccd1dc32c0faf5e544d17daca4a417d1d168c21
2017-10-24 18:43:45 +02:00
Max
bf9298eb0f Make power test more verbose
Power control loop test outputs next to nothing which is not very
helpful. Make it more verbose. While at it, also move duplicated code
into static function to make test cases less cluttered.

Change-Id: I0a5e65e23e62442ef8758ecbcf8e7820b4f15d7b
Related: OS#2223
2017-10-24 10:04:09 +00:00
Max
fe291a97c2 Move power loop to generic tests
There's nothing sysmobts specific in this test so let's move it into
separate directory and run unconditionally. The test itself is unaltered
except for intro text.

Change-Id: I0d1957cd9cf5497826be095c7a42b7bb4fa10397
Related: OS#2223
2017-10-23 18:13:13 +00:00
Max
36fa0bd079 Fix race condition in attribute reporting
Previously it could be possible that the attribute request comes from
BSC before the TRX is properly initialized which would lead to SIGABRT
caused by OSMO_ASSERT() in PHY instantiation. Workaround this by
explicitly checking for TRX availability before handling TRX-specific
attributes.

This only happens with osmo-bts-trx and is hard to reproduce. Ideal fix
would be to defer attribute response until we have TRX connected but
that would make corresponding code more complex because we'll need to
save the attribute request and properly hook response routine into TRX
connection handler. Alternatively we can postpone osmo-bts-trx
connection to BSC until TRX is available: it's not very useful without
it anyway.

Change-Id: Id36885e507c4a3203b5662c0fde12c5206174d82
Fixes: OS#2560
2017-10-23 18:12:45 +00:00
Pau Espin Pedrol
0a21b7a5f8 vty: Print string for Administrative state
Change-Id: Ie41479958d6a57708e4b50705fd85c65f02e4527
2017-10-23 18:49:49 +02:00
Neels Hofmeyr
0c9bc5422a osmo-bts-trx: vty: various fixes of 'write file' and doc
On 'write file':
- Write 'osmotrx' before 'maxdly' and 'maxdlynb' (broken since "Introduce new
  phy_link and phy_instance abstraction"
  d784e50747)
- Fix indenting of 'write file' output, command 'osmotrx timing-advance-loop',
  had a stray space in case there is not a 'no' preceding it.

Add some missing instances of OSMOTRX_STR doc strings.

examples/osmo-bts.cfg:
- Drop 'settsc', the command no longer exists.
- Fix indenting of 'osmotrx rx-gain' command.

osmo-bts does not feature VTY tests, so it is pointless to add example files to
test these fixes. We should probably add VTY tests separately.  However, I have
briefly tested manually (and hence found all of these issues).

Change-Id: I018eaef40345bfa26e12eb7d09e83a52596c1000
2017-10-18 14:02:30 +00:00
Max
8c9bc5c6c7 sysmo: don't override clock source with defaults
Previously clock source configured via vty was ignored. Check that it
wasn't configured and only apply default value in that case.

Change-Id: I8de74a12d2096971a8a83946dc6c7cdb9889acd7
Fixes: OS#1944
2017-10-11 18:06:55 +02:00
Max
3552247ae8 sysmo: use clock calibration source wrapper
Make get_clk_cal() public and use it for ctrl commands handling. This
ensures that the calibration is properly selected depending on the clock
source.

Change-Id: I1c809d48f29ef8e8c50641f882d7a954dfcf88f9
Related: OS#1944
2017-10-11 17:53:46 +02:00
Max
2d3aa02ba3 jenkins: remove openbsc dependency
The dependency on OpenBSC has been removed in
ec33b0397f so we can drop it from jenkins
scripts too.

Change-Id: Ie28d444f2154f5b4bbbd9a1cb45b74ebca890cb1
2017-10-10 12:30:16 +00:00
Max
236269397e Fix multiple SI2q reception
Previously the received SI was copied to si_buf unconditionally which
means that the first SI2q message is always overwritten be the last one.

Fix it moving check for SI2q ahead of generic code and moving generic
copy into else branch of SI2q check.

Change-Id: Ib8031d2f0e00368283a40b4aadb3eea616038d04
Related: OS#2357
2017-10-10 14:09:44 +02:00
Pau Espin Pedrol
d49915eccf l1sap: Improve log msg when frame diff >1
Print the two fn values to understand better the wrong behaviour.

Change-Id: I4f7b3ffbf7ce3a8d8d6872e4281ef228f4c5527f
2017-10-10 08:21:00 +00:00
Max
ec33b0397f Remove build dependency on legacy OpenBSC
* copy-paste gsm_data_shared.* from OpenBSC master
* remove corresponding configure check and option
* remove .deb dependency

Actual refactoring with removal of unnecessary structures/parts, moving
common OpenBSC/OsmoBSC parts into libraries etc. are left for further
patches.

Current patch will make coexistence with *BSC easier and will simplify
our build infrastructure.

Change-Id: I9f004fb5c4c1db29d4792dfd281d388c7063da13
Related: OS#1923
2017-10-08 18:40:09 +02:00
Max
8a89c7d3c3 vty: print version and description for each phy
When printing BTS via 'show bts ..' let's also print each TRX, which phy
number and version it uses and its description. It's helpful in
troubleshooting low-level issues as it allows vendor-specific code to
easily expose firmware version.

Related: SYS#3884
Change-Id: Iabcc862566b40a9314f3e1d17fda61d8ab24a3cd
2017-09-27 14:07:55 +02:00
Max
ab4696bb2f Replace dead code
* remove leftover from copy-paste of corresponding OpenBSC code
* print OML link state
* print paging load

Change-Id: Ia5e3dc10efe2b5ab212cab1518a10d36b20b8bb2
2017-09-27 14:03:10 +02:00
Neels Hofmeyr
9605b695fa vty: mgr: sysmobts, lc15: install default commands for ACT_NORM_NODE
Change-Id: Ia1b3d5e010c5b6ea8e655b79d9b36b08cd1ef4c4
2017-09-19 03:27:29 +02:00
Max
ae134f896a OML: print actual type of report sent to BSC
We re-use the same facility to send different data so it's better to
print actual cause value to avoid confusion.

Change-Id: I9413ecf57eaa6fc661f1a57ccdaa2f04c50ea43b
2017-09-11 07:50:18 +00:00
Max
cb9f608094 Check readv() return value to prevent crash
Previously result of readv() was used unconditionally so when it failed
and returned negative value it was treated like very large positive
which lead to memory corruption. Fix this and add proper error log.

Change-Id: I956c8d551f45c9dd43b5e9de11dfe20dd8783647
Related: SYS#3865
2017-09-08 13:27:06 +02:00
Max
9e36dca82a trx: avoid deactivating lchan on LCHAN_REL_ACT_REACT
* do not deactivate lchan when called with LCHAN_REL_ACT_REACT
* add fixme comment

It's unclear yet if any special steps are required for osmo-bts-trx so
let's just make it compatible with setups [1] using BS_AG_BLKS_RES != 1
for now.

Background: CCCH is auto activated by some OsmoBTS - before we receive
SI3, see 4a85828462. To accommodate for
that we deactivate CCCH in common/rsl.c, which triggers BTS-model
specific callback sapi_deactivate_cb() which updates parameters and
activates it again.

In case of osmo-bts-trx there is no auto-activation and (seems to be) no
need in special interaction with hw to activate channel (no
lchan_activate()) hence we can just skip entire
deactivate/setup/activate again routine.

[1] "channel-descrption bs-ag-blks-res N" in OpenBSC config file.

Related: OS#1575
Change-Id: I20b89ba1e43d1414180b083cd1e085eeffe5d513
2017-09-02 19:44:54 +00:00
Max
bbf6c435f6 Support removing SI13 from PCU
If SI13 becomes unavailable in runtime than send 0-length message with
BCCH SAPI to PCU to indicate that SI13 have to be removed.

Change-Id: I72aef8bd98f21c4b5ea6eed21fc56b30d85bfc1b
Related: OS#2400
2017-09-01 16:13:02 +02:00
Max
6384c73fbf Support sending SI13 to PCU
* explicitly set SAPI when sending data_ind to PCU
* drop unused receiving code for BCCH SAPI
* send SI13 when PCU is connected
* send SI13 when new SI is received

Change-Id: I9e83ef792585aa962f99897d9973cef12f186bcf
Related: OS#2400
2017-08-31 14:44:45 +02:00
Max
fab4efdaf5 Use value string check from osmo-ci
Change-Id: I5bce234a5b8133c81b3ea8757e05de56d3aa15d8
2017-08-26 06:10:35 +00:00
Max
1283e3d543 Bump version: 0.5.0 → 0.6.0
Change-Id: I613d09ae0f9f0aa67be1dc6015da1fb9314110fd
2017-08-25 15:51:56 +02:00
Max
b026d38703 Add git-version-gen snippet
Change-Id: Id1732921ecb768b3c3c4872b82b74ccc3d26cf77
Related: OS#1861
2017-08-25 15:41:43 +02:00
Pau Espin Pedrol
8876a507ff osmo-bts-trx: Relax validation to allow TRX data bursts without padding
Original OpenBTS transcievers add 2 bytes of padding to the end of data
bursts, having in total 158 bytes. As those two extra bytes are being
ignored after the initial validation, let's relax this validation a bit
in order to accept transcievers that decide no to send these two extra
bytes.

Change-Id: I94c3cb160bfed0ba9c41ed7ef5f8d8a65b81ad07
2017-08-25 09:34:51 +00:00
Max
aa11997480 osmo-bts-trx: remove global variables from loops
* move TA related globals into phy_link
* move power loop related globals into phy_link
* prefix corresponding vty vars with osmotrx

Change-Id: I01d7c1abad67e51b886a4ecf2de072929d67da27
Related: OS#1848
2017-08-24 19:06:48 +00:00
Max
9a30b77813 osmo-bts-trx: fix 'osmotrx legacy-setbsic'
It was introduced in fe6c75d24a:

* fix typo in config write
* add missing vty help string

Change-Id: Id42359dfbb8ad02f34dd2540db66f3ed69ad5181
2017-08-24 19:06:48 +00:00
Max
01e84be54f OML: use fom_hdr while handling attr. request
Use Obj. Class and TRX# from abis_om_fom_hdr of incoming request instead
of BTS' MO to properly distinguish between BTS-level and TRX-level
attributes.

Change-Id: I8b5a5ab8bd07daf2500b66dec428b89b7f8cd852
Related: OS#2317
2017-08-22 13:29:25 +00:00
Alexander Chemeris
2bbf98afa3 Fix static build of osmo-bts-trx and osmo-bts-virtual.
New libosmocore has some plugin system which requires dlopen(). So we need
to make sure we always link with libdl, even when building statically.

Note that this doesn't fix static build of tests - they are still failing
with some errors.

Change-Id: I8315d6e032e34528def268a49fd88d07bc06ab2e
2017-08-20 19:29:30 +00:00
Harald Welte
4d5df2ebd1 Treat SIGTERM just like SIGINT in our programs
When somebody kills the process, it's best to handle the signal
and to use the opportunity for some cleanup.  We always did this
in the BTS on SIGINT, but never on SIGTERM. Let's change it.

Change-Id: I10009c08b7178988f646e2b6035197b9640ac9b5
2017-08-20 19:23:34 +00:00
Alexander Chemeris
ed662e0799 osmo-bts-trx: Increase a maximum allowed MS power reduction step from 2dB to 4dB.
We tend to start MS with high power to make sure distant phones get good QoS,
but this also means that we need to reduce their power rather quickly. OTOH
we can't make this step too high because this may lead to power output
oscillation. From my (manual, limited) testing 4dB looks like a reasonable
compromise.

Change-Id: I58785513e5739474b881ed7f2a312ecc690e7e60
2017-08-20 01:45:29 +03:00
Alexander Chemeris
b0578dda95 osmo-bts-trx: Remove an unused variable. Resolves a compiler warning.
Change-Id: I2464e872f81021cbc3ccbc4e2e32c394d6afcf70
2017-08-19 22:38:20 +00:00
Alexander Chemeris
d4450051fc osmo-bts-trx: Fix MS power control loop.
The following two commits from 2014-12-06 introduced a new variable to control
MS power - ms_power_ctrl, but kept the old ms_power variable in place. They
have also changed the meaning of the ms_power variable - it now keeps original
RSL configured value. So when much later osmo-trx-bts code was merged to master
the code was compiling fine and this change in the meaning was overlooked.

In osmo-bts:
579651bf30 power/sysmobts: Add a manual ms power level control
In OpenBSC:
f6f86b0eec18da165db136b14bf2db87fde4b4ac osmo-bts: Introduce new struct for a power loop in the BTS code

Change-Id: I713e39b882db32a0d17aa04790d16fa79afa1fb1
2017-08-19 22:35:10 +00:00
Max
b78fc1eeee Simplify jenkins build scripts
* move duplicated code into separate functions in jenkins_common.sh
* use that function in individual builds

Change-Id: I4d09c5f2693b5ac0a4d8f2c840971e13d1ec58cf
2017-08-18 18:08:31 +00:00
Philipp Maier
69ec4a419e octphy: implement support for dynamic timeslots
Implement API functions bts_model_ts_connect() and
bts_model_ts_disconnect() in order to support dynamic timeslot
allocation.

Change-Id: Ia109d4bfade7bc28442127581f4bb0289146ea71
2017-08-15 18:29:21 +00:00
Pau Espin Pedrol
506a7f98b2 osmo-bts-trx: Enable osmotrx tx-attenuation oml by default
There are currently two ways to specify power reductions to be sent to
osmo-trx from osmo-bts-trx:
* osmotrx tx-attenuation oml
* osmotrx tx-attenuation <0-50>

None of them is enabled by default, which means if none of them is
specified in the config file of osmo-bts-trx, SETPOWER cmd won't be sent
to osmo-trx, which in turn won't turn on the transciever.

Let's enable osmo tx-attenuation oml by default and leave it up to the
bsc to decide which power reduction to use. If the user wants to
configure a specific tx-attentuation, it can still do so in exactly the
same way he used to do it.

Change-Id: Ia8640751630ee37e5f5d1f470bad892a08e80654
2017-08-15 14:59:04 +02:00
Harald Welte
fb78397cbd Fix build after recent gsm_bts_alloc() change
In openbsc.git Change-Id I61c18a7f021fcb1ec00d34a745f4e3ab03416c2d
we changed the gsm_bts_alloc() function signature to include
a second argument (the BTS number).  This broke omso-bts, and this
commit is intended to make it build again.

Change-Id: I7ef7654d48c1cfc7e4ecb0b771553ec0740ce2bf
2017-08-14 01:22:12 +02:00
Harald Welte
fe6c75d24a TRX: Remove global variables, move SETBSIC/SETTSC handling into phy_link
Whether or not we are talking to an OpenBTS (SETBSIC) or OsmoTRX
(SETTSC) transceiver is a property of the phy_link, and not a property
of the BTS.  Also, we *really, really* should never use global
variables. I'm very happy this is being cleaned up, finally.

Change-Id: I51aeb17661dfd63ff347f7b2c0d7ffa383ec814c
2017-08-09 13:03:33 +00:00
Harald Welte
bd65b72f91 l1sap/osmo-bts-sysmo: Improve logging
Change-Id: I339db0e5f3fd5e44bac974f2447afc80388802af
2017-08-09 13:02:56 +00:00
Harald Welte
cd1b08b14f TRX: Remove bogus extern global variable declarations
Those global variable declarations for non-existing variables were
introduced in 8a8d73a691, let's remove
them again.  The source / destination IP address is a parameter of the
phy_link, and not a global variable.

Related: OS#1848
Change-Id: I94b5f934fc3bd00b0467d90029d3053b16594186
2017-08-09 11:18:46 +00:00
Harald Welte
bc56094cac GSMTAP: Don't log fill frames via GSMTAP
There's very little point in sending fill frames (such as empty PAGING)
or dummy UI frames via GSMTAP all the time.  They serve no purpose other
than to bloat the log files and make it more difficult for users to find
the interesting bits among all this noise.

Change-Id: Icd18dafb235933c9e6aa9d98ddd8fac1522cc9ac
2017-08-09 10:03:30 +00: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
d1f8001cdf VIRT-BTS: Support for GPRS
Change-Id: Id851578c53255866537a16a0be6c3e9268e6ccbc
2017-08-09 10:02:33 +00:00
Pau Espin Pedrol
6fe823a7e1 lc15bts-mgr.service: Prepare dirs and sysctls for the process
Change-Id: I0a0a10ca9498318c48c81fa94faceb2ad4ac1de6
2017-08-07 11:56:11 +02:00
Pau Espin Pedrol
d208132ab9 lc-15, sysmo: l1_if: print name on PH-DATA.ind unknwon sapi
Change-Id: I007e5f0ce9709026331817e55148749e21d8b015
2017-08-01 10:22:55 +00:00
Pau Espin Pedrol
dc469994f3 lc15: Tweak led colors used in service file
service sets led to orange before/while osmo-bts is being started.
osmo-bts-lc15 sets led to green while operating. (unchanged in here)
service sets led to red when osmo-bts stops running.

Change-Id: If351f49d1ead359192d0d80bbc381afd3459c940
2017-07-31 11:55:12 +00:00
Harald Welte
82987f7a7d L1SAP: Print chan_nr and link_id always as hex
The RSL Channel ID is best read / interpreted as hex value, not as
decimal, primarily due to the fact that it is a bit-mask of various
fields.

Change-Id: I9b72a67407870b485e7f7e8a72fa1ad30fc8ed4d
2017-07-30 17:38:37 +02:00
Harald Welte
d6da809d2f TRX / VIRT-PHY: Make check for BCCH/CCCH more specific
In bts_model_l1sap_down() we want to identify BCCH/CCCH channel numbers,
but our check is a bit non-specific.  Let's make the check more specific
to only cover the BCCH, Uplink CCCH and Downlink CCCH C-bits as defined
n 3GPP TS 08.58 Section 9.3.1

Change-Id: Ia20ab09b96c87c0dfbfaf98e5b2a8d36423fac67
2017-07-30 17:38:37 +02:00
Harald Welte
69e0461674 VIRT-PHY: Print NOTICE log message from unimplemented stubs
There are plenty of functions stubbed out in osmo-bts-virtual, let's
print a NOTICE level log message to be able to correlate any kind of
erroneous behavior with the fact that a given function has no actual
implementation.

Change-Id: Ib607d192f90af7fb2d5a8747de5527f39e3cfefa
2017-07-30 17:38:33 +02:00
Pau Espin Pedrol
bbd4d54e46 cosmetic: lc15bts_mgr_vty.c: Fix typos in comments
Change-Id: I46b1cc6e5502829e0c1dc84a184cd2002fbd2b18
2017-07-25 19:21:27 +02:00
Pau Espin Pedrol
8edfe03595 litecell15: Register in vty limits for paX_pwr
Otherwise it fails to read the default config file.

Change-Id: I316a8ea73091c7e76a175314b890e4d86e9c3010
2017-07-25 17:17:25 +00:00
Pau Espin Pedrol
cbb64cffa5 cosmetics: Fix typos and whitespace in lc15bts_mgr_vty.c
Change-Id: I6e35fb9c1a6391e5185a62e9efd2f8ffba13cf0d
2017-07-25 17:17:25 +00:00
Pau Espin Pedrol
824764fa6b lc15bts-mgr.cfg: Set default vswr to a value inside valid range
Valid range is currently set to 1000-200000.

Change-Id: Ibf60ab290acf0423c7617591a86403d63266e5d3
2017-07-25 17:17:24 +00:00
Pau Espin Pedrol
db4ab8e5ce cosmetic: Move error goto path to the end of the function
Change-Id: I3ad15a9edbfe74de3deb7298441d54fd9d0178ad
2017-07-24 22:00:00 +00:00
Pau Espin Pedrol
69de62a573 cosmetic: scheduler_trx.c: Add function to get rid of ugly goto path
Change-Id: I9c2e166e6f182f703ccf49aa883c223e377c8421
2017-07-24 22:00:00 +00:00
Pau Espin Pedrol
9dccaa2064 cosmetic: scheduler_trx: Remove trailing whitespace
Change-Id: Ib057b5e5219ad2acfaee2dcc9ade098daa9ac985
2017-07-24 21:59:59 +00:00
Max
0ebf985492 lc15: port lc15bts-mgr dependency changes
That's mostly changes related to lc15bts-mgr from
https://gitlab.com/nrw_noa/osmo-bts branch nrw/litecell15 based on
eb5b7f80510b603579f7af6d7d5ead296c2fa260 commit:

* adjust comments to simplify further diffs
* add libsystemd dependency to lc15bts-mgr
* add software watchdog which uses it
* ocxo calibration and gps related code

Change-Id: I475a330af771891ba3c897294ce0dd57ec2ba8db
Related: SYS#3732
2017-07-22 09:07:44 +00:00
Max
8785978c37 lc15bts-mgr: separate service file
The sysmobts- and lc15bts- mgr have different semantics for the same
command line option (-n: writing to EEPROM vs writing  to ROM). and
different default value. Hence it make sense to use separate files,
similar to osmo-bts-*.service

Change-Id: I645a81e30d7146ff26720391db763b6d585037e6
Related: SYS#3728
2017-07-21 17:12:17 +02: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
Harald Welte
d7546ed090 VIRT-PHY: Report virtual RACH bursts with plausible burst type
Change-Id: I35b103c512993fc52d4e608f07115a4bb4b21022
2017-07-19 16:02:25 +02:00
Harald Welte
f66d2fc1e6 virt: Don't print NOTICE log message if ARFCN doesn't match
In a larger simulated network with multiple BTSs it is normal that one
BTS will see GSMTAP frames for an ARFCN that is not an ARFCN used by the
local BTS.  This is just normal operation.

Change-Id: Ic68cace9648ccb17500c94b6ede8814674aa9c29
2017-07-19 16:02:25 +02:00
Max
2d2fca4342 lc15: port lc15bts-mgr changes
That's mostly changes related to lc15bts-mgr from
https://gitlab.com/nrw_noa/osmo-bts branch nrw/litecell15 based on
eb5b7f80510b603579f7af6d7d5ead296c2fa260 commit.

I wanted to incorporate vty and hardcoded paths changes so we can use it
from this point without major backward-incompatible changes as a base
for future ports.

Change-Id: Iabbaedc84aaaa594150a4e5445c16dd1f6f89858
Related: SYS#3679
2017-07-19 11:47:47 +02:00
Max
b2bbc81921 lc15: make default config usable
* add trx-calibration path
* change GSM band to 900

Change-Id: I50bc4a4314a8b48e4000de445f4f05795e1a2d8b
Related: SYS#3722
2017-07-18 17:30:07 +00:00
Max
91cecc051a lc15: fix BTS revision and hw options
* remove typo in logging
* add missing return statement
* fix compilation warnings
* add detailed logging for supported GSM band and related errors

Change-Id: I73bccd81ec56845ba11b939937b295eb0f51b4a8
Related: SYS#3728
2017-07-18 19:02:02 +02:00
Max
173a4f1f79 lc15-mgr: update parameter read/write
Better match upstream lc15 code:
* fsync on parameter write
* use permanent storage directly for parameters

Change-Id: Iac150bf2ebffc5fa9544b0f3b19cd647996fc8b6
Related: SYS#3728
2017-07-18 12:49:50 +00:00
Max
f690e5d45c lc15: cleanup board parameters reading
* move common code into separate function
* print error similar to parameter reading code

Change-Id: Icf3285d7bb921d212cb8945e835be2c81189fb87
Related: SYS#3728
2017-07-18 11:41:56 +00:00
Max
a59fb6220b Unify *.service files
* unify description
* provide common BTS-independent aliases

Change-Id: Ia067dc5b0bdef07b90ab57f89e8ba6b2a794eb4a
2017-07-17 17:38:37 +02:00
Max
df07f0a9cb Fix .deb build
Recent introduction of VIRT-PHY broke .deb build. Fix it by installing
osmo-bts-virtual as part of Debian package.

Change-Id: I1ca7eb51019247eb95c6bac752d6e2c4406ce5a2
2017-07-16 21:15:36 +00:00
Harald Welte
3617fd1cb6 Ensure we don't send dummy UI frames on BCCH for TC=5
When no SI 2bis, nor 2ter, nor 2quater is in use, then the code in
bts_sysinfo_get() will return null, causing the transmission of a dummy
frame (0303012B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B2B) instead of a
system information message. This is - at least - very odd and might not
be backed by the specification. We should simply send any other system
information message instead of sending a frame that does not have a
valid SI header.

While 030301 might be a valid, empty UI frame on a DCCH, it is not a
valid frame for the BCCH, where the header is structured differently.

In fact, bts_sysinfo_get() should never return NULL and always return a
valid BCCH message.

This bug was found while developing
http://git.osmocom.org/osmo-ttcn3-hacks/tree/sysinfo/Test.ttcn

Change-Id: Ifeaed27d1d7ba9994fb8ce67d660648bcc8efece
Closes: OS#2365
2017-07-15 22:36:10 +02:00
Max
e0e2b9e303 Cleanup example config files
* remove deprecated everything log level
* remove copy-pasted sysmobts-mgr.cfg from root directory

Change-Id: I8f392991097267665e9094189d24e7cf94a5d5d2
Related: OS#71
2017-07-14 14:30:01 +02:00
Harald Welte
576408b651 VIRT-PHY: cause BTS to terminate in case of recv()/send() on udp socket returns 0
It is important that we reliably terminate the BTS in case any of the
VirtPHY multicast sockets dies for whatever reason.

Change-Id: I5ae3fdd7cc35fdf235550a3b8362020fdd287c13
2017-07-13 21:35:33 +02:00
Harald Welte
e3b8279f26 VIRT-PHY: Use IPv4 multicast groups for private / local scope
The addresses in the original code make little sense:
* 224.0.0.1 is "All systems on this subnet" and not routed
  outside the local ethernet segment
* 225.0.0.1 is in a RESERVED range that shouldn't be used

Change-Id: Iba1ae69f3f193a33f1da343c6562f67bd8d3557f
2017-07-13 21:35:33 +02:00
Sebastian Stumpf
6feae225eb VIRT-PHY: Added test option for fast hyperframe repeat.
Frame number will restart at 0 after each superframe (approx. 6.1 sec)
if enabled. Can be enabled by preprocessor define.

Change-Id: If3adf14df5fcd8daf53363c27b3772c42d7122e9
2017-07-13 21:35:33 +02:00
Harald Welte
3cda4ff532 VIRT-PHY: Fix handling of default values for vty configuration
The defaults must be set during bts_model_phy_link_set_defaults()
and can then later be overridden by the vty (from the config file).

They should only be written back to the file if they differ from
the default settings.

Change-Id: I5d7f2c1dc8bc3d11db5c607b664730e4dcd58c96
2017-07-13 21:35:33 +02:00
Sebastian Stumpf
1f45db0ff5 VIRT-PHY: Fixed timeslot in gsmtap-msg on downlink which was always 0.
Timeslot is not encoded in the chan_nr accessible in the channel
description but was taken from there and so it was always 0.

Change-Id: I881a1c61ea47399c9b1385fb220cd587e3593e82
2017-07-13 21:35:33 +02:00
Sebastian Stumpf
81335edae3 VIRT-PHY: Added example configurations for openbsc and osmobts.
Change-Id: I368d4a378e20028603b09825eee766abb9195774
2017-07-13 21:35:33 +02:00
Harald Welte
5eb17e28ac VIRT-PHY: Initial check-in of a new virtual BTS
This patch adds a virtual physical layer designed to simulate the
Um air interface between BTS and MS.  It does so by encapsulating MAC
blocks (Layer 2 PDUs) via GSMTAP and sending them through multicast UDP
streams, both in uplink and in downlink.

The purpose of this is enable testing without any radio hardware or
related licenses.

OsmocomBB has recently received as similar patch-set, adding a virty_phy
executable that can be run on a PC instead of the classic 'layer1'
firmware on a real phone.

Using GSMTAP means that one can use unmodified wireshark to decode the
messages exchanged on the virtual Um layer.

This code was originally started by Harald in January 2016, continued
by Sebastian Stumpf in late 2016 and early 2017, and finally completed
by Harald in July 2017.

Change-Id: I1bf7670975b1e367c1c62983020865a043542622
2017-07-13 19:34:17 +00:00
Max
152c2f489c si2q: do not consider count update as error
The number of SI2quater messages might be updated dynamically by
BSC (via 'bts 0 resend-system-information' command for example). Log it
but do not return error.

Related: OS#2357
Change-Id: I9625be879c672e20543cc40af288828143ffb983
2017-07-11 16:22:29 +00:00
Philipp Maier
9a2187e7b1 octphy: remap frame number in MEAS_IND
The octasic phy stamps the SACCH channel that carries the
measurmenet indication with the frame number of the last
SACCH that falls within the measurement period.

The higher layers expect the frame number to be aligned
to the SACCH channel after, which marks also the beginning
of the next measurement period.

Make the octphy code compatible to the higher layers by
remapping the measurement indication frame number.

Change-Id: I8ecb27c018bf4ad5151878a6ad34026fd0f801a1
2017-07-10 16:14:56 +00:00
Philipp Maier
65db0f5c41 measurement: fix measurment report
The end of the measurement reporting period is not aligned with the
SACCH block where the results are reported. The tables that are
used to detect the end of the measurement period are therefore
wrong. The frame number of the SACCH block must be used and not the
TDMA frame number (modulo 104) of the measurement reporing interval.

The tables are oriented to the frame number of the first SACCH block,
at the beginning of an interval. However, when a SACCH block is received
it will always contain the result of the recently passed measurement
reporting period.

To match the tables, introduce another lookup table to remap each
SACCH block that ends to the matching beginning block number.

Change-Id: I1eef894e6f15b4449fc8926bebb118624efc7924
2017-07-10 15:30:59 +00:00
Philipp Maier
9a280eba48 osmo-bts-sysmo: Include frame number in MEAS IND
l1_if.c does not generate struct osmo_phsap_prim l1sap properly.
The frame number is not included in this struct. This renders the
logic that processes the reported measurements non functional,
since the logic (see measurement.c) is not able to detect the
end of the measurement period. This commit fixes the problem by
adding the missing frame number to the l1sap structure.

Change-Id: I09241d6cc2ff09e71a3d723d90e4468108a27ae1
2017-07-10 13:07:30 +00:00
Harald Welte
7887ce7aea jenkins helpers: some minimal documentation/comments + print errors
We should print meaningful error messages in case a user doesn't have
the required local PATH set up, or doesn't specify a required command
line argument.

Change-Id: I30a2935f93ade69222b1e0c3e212ee10e17c1823
2017-07-10 14:55:25 +02:00
Philipp Maier
6a538a0921 octphy: do not send empty frames to phy
ph_data_req() and ph_tch_req() are generating empty (idle)
frames when no data (msg == NULL) is available. Since the
phy is able to generate idle frames internally, there is
no need to waste Host CPU cycles by doing this in software.

Remove the empty frame generation and exit the function
cleanly.

(Patch by Octasic Inc.)

Change-Id: Ib857b7dab490ad426c48d6a9e5e6fa10ef5a0838
2017-07-10 08:45:41 +00:00
Pau Espin Pedrol
390742b3ed Use osmo_dump_gsmtime to log fn across different layers
This commit also fixes a missing end of line in the log output of handle_ph_data_ind

Change-Id: I049f58d51333d3590361db5c0105e6899a862af6
2017-07-10 08:44:03 +00:00
Pau Espin Pedrol
f06ba300c4 Move dump_gsmtime to libosmocore as osmo_dump_gsmtime
Internal l1sap dump_gsmtime has been moved to libosmocore as osmo_dump_gsmtime.
Remove use of internal function and replace with the libosmocore version.

Depends on libosmocore Ib5452e2c20f53006c0f6d197fb055728947125d8

Change-Id: Ia2f89965d970ed5bbb8c0d4f591a043e58c4bd66
2017-07-10 08:44:02 +00:00
Pau Espin Pedrol
ffdc05bc4e l1sap.c: fn_ms_adj: Add err logging and always return GSM_RTP_DURATION
After latest changes, l2 expects to receive an event for every TCH
frame, that is, no TCH frame event should be lost on that layer. We
should now then be safe returning always GSM_RTP_DURATION.

The code which used to calculate the variable duration is left there to
assert that indeed we are not longer having this kind of issues.

Change-Id: I9d112c6db142be138e71393e77129e6d069d9973
2017-07-10 08:44:02 +00:00
Pau Espin Pedrol
c2d3f14bfb l1sap.c: Avoid sending RTP frame with empty payload
Depends on libosmo-abis Id6099372b6231c0a4b6ea0716f46f5daee7049e1

Change-Id: Ie9053674aa4f43aac20dbd5c865d70317360abbc
2017-07-10 08:44:01 +00:00
Pau Espin Pedrol
f588b5f91d Allow passing low link quality buffers to upper layers
We want to always call l1if_tch_rx and l1sap_up in order to avoid losing triggering
events on the upper layer.

With this change, the upper layer will increase correctly seq + ts for
RTP. It will then send an RTP packet with only the header and no payload, which is
not correct but at least we avoid drifting the RTP clock. Upcoming patch
in the series solves this issue.

This patch assumes that we are not lossing data events from the physical
layer and that we receive an event every 20ms, even if the MS is not
transmitting due to DTX.

Depends on libosmocore If4ae20c22b881e94585dad710f17b9e37f77bf82

Change-Id: If5df8940fab833eb4e3ed851880b66987d356031
2017-07-10 08:44:00 +00:00
Max
0bd7a19114 Use release helper from libosmocore
Change-Id: Ib8efd2095fcf759276299b516d495219105c1f2b
Related: OS#1861
2017-07-10 08:24:40 +00:00
Pau Espin Pedrol
aa15504097 sysmo: Remove non longer valid -p option from help
The dsp-trace-flags command line argument was removed
in 9684099ae9

Change-Id: I8dbcdc7080ca3f7d7968aeef24422faa75d925fe
2017-07-05 11:29:12 +02:00
Pau Espin Pedrol
3ae0be0f12 sysmo, litecell15: Make sure all TCH events are triggered
Change-Id: Ie674c7ec40838af36308c6998f227fa452ace4b4
2017-07-04 13:36:53 +00:00
Pau Espin Pedrol
523ae04e5e Fix annoying trailing whitespace
This whitespace keeps being automatically fixed by editor, polluting my
patches.

Change-Id: If0ba1321ed326c1498e3f60b611bd962f2a9484a
2017-07-04 13:36:52 +00:00
Pau Espin Pedrol
171d80a8d6 Use L1P instead of L1C for TCH logging and allocation
L1C is for L1-Control primitives, while TCH channels are L1 Data
channels.

Change-Id: I07ea3a7326bfcb62271d58deb0743311f6d97c8b
2017-07-04 13:36:52 +00:00
Philipp Maier
8baa45a8e3 octphy: complete value strings (octphy_cid_vals)
The value string table octphy_cid_vals lacks the strings for
cOCTVC1_MAIN_MSG_APPLICATION_INFO_CID and cOCTVC1_MAIN_MSG_APPLICATION_INFO_CID

(Patch by Octasic Inc.)

Change-Id: I9843137b55534a29938d5c2308244a6950de788f
2017-07-04 13:36:24 +00:00
Philipp Maier
3902e4d9c4 Revert "osmo-bts-sysmo: Include frame number in MEAS IND"
This reverts commit 3f97e4b1fc.

Change-Id: Ib50c813c470bf6ea740fe6667431eaa1a23fdd8d
2017-07-04 11:53:12 +00:00
Harald Welte
9b97d0f683 TRX: permit transmission of all-zero loopback frames
For some reason, osmo-bts-trx attempted to interpret/validate the
contents of the downlink TCH block that it was about to transmit.  If
such checks are made, they should clearly be in the common part above
L1SAP, and not in the bts-model specific part.

Also, having the checks in place didn't allow us to send an all-zero
downlink block, as is required for detection of uplink FER in a loopback
testing setup, e.g. with CMU-300.

Change-Id: I6388de98e4a7e20843a1be88a58bba8d2c9aa0d5
2017-07-02 07:02:29 +00:00
Harald Welte
a38d34112f l1sap: Don't enqueue PTCCH blocks for loopback
When we're in loopback testing mode for PDTCH, we must make sure to
avoid adding PTCCH blocks to the queue. Only PDTCH blocks must be
enqueued. For the transmit (downlink) side, we already had the PTCCH
check in place.

Change-Id: I7ef40d9bdf74a99375bc6568ed9483499664bf6f
2017-07-01 07:38:40 +00:00
Harald Welte
cc1602f592 TRX: don't free l1h in trx_phy_inst_close()
l1h is allocated in bts_model_phy_instance_set_defaults() and not in
trx_phy_inst_open().  Hence, trx_phy_inst_close() should not free() it!

Change-Id: I0ac4e57a882e5a31143499c1662d8d8e52320938
2017-07-01 07:38:03 +00:00
Harald Welte
f2eaba8869 TRX: merge/simplify l1_if and trx_if code
Related code / function structure still dates back to the pre-phy_link
days.  Let's clean this up to make things less convoluted and reduce the
number of non-static symbols needed between code split over two files.

Change-Id: I1f30ae1f547a5c01c516d4a05032193294c25f2d
2017-07-01 07:38:01 +00:00
Harald Welte
cdf20fec7c TRX: Rename trx_if_data() -> trx_if_send_burst()
The new name makes it clear what the function actually does: Send burst
data via the trx interface.

Change-Id: I5031541d4ae4244a62a18acf71139db2874927fa
2017-07-01 07:38:01 +00:00
Harald Welte
bb71947829 trx_if: Improve error handling
There ware some error conditions that the previous code didn't catch
and/or report, such as unparseable TRX control strings, non-terminated
buffers, ...

Change-Id: I354d0c121880553ce1bd59b7394d52b104b7d6da
2017-07-01 07:38:01 +00:00
Harald Welte
c19ab9ed2f TRX: trx_if: Improve code description / comments
Change-Id: I4e19d68782a12e52ba1d3ba2665060275d04866c
2017-07-01 07:38:00 +00:00
Pau Espin Pedrol
7738f5282f litecell15/tch.c: Clean up use of empty buffer
Make code easier to read and avoid reading first byte of the buffer if size is 0.

Change-Id: Ib9ee967c0f42098b3a0569e9d84f23832eb4f2d5
2017-06-30 08:48:34 +00:00
Pau Espin Pedrol
0ada527bc0 sysmo/tch.c: Clean up use of empty buffer
Make code easier to read and avoid reading first byte of the buffer if size is 0.

Change-Id: I5ecfc4df5a3fcad3d3ad50bf3dd3db65b694481a
2017-06-30 08:47:57 +00:00
Philipp Maier
dd3c7815a5 osmo-bts-litecell15: Fix missing frame number in MEAS IND
The layer 1 interface (l1_if.c) for osmo-bts-litecell15 does not include
the frame number into the measurement indications it forwards
to higher layers. The frame number is required to properly
detect the end of a measurement period.

change process_meas_res() to properly include the frame number into the
l1sap primitive (struct osmo_phsap_prim *l1sap)

Change-Id: Iee9c8f88b05cd5dba9920bb08e079a643e713237
2017-06-29 17:41:01 +02:00
Philipp Maier
b7425f3642 osmo-bts-trx: fix missing frame number in MEAS IND
The layer 1 interface (l1_if.c) for osmo-bts-trx does not include
the frame number into the measurement indications it forwards
to higher layers. The frame number is required to properly
detect the end of a measurement period.

Change-Id: Ife3c791ff50e8a866a97b9783ac7ef3ef2402a70
2017-06-29 17:29:56 +02:00
Philipp Maier
8d645dd0e5 Revert "sysmobts: normalize frame number in measurement indication"
This reverts commit 88b2cc30a6.

Change-Id: I30f37a9feef24a45e254377502615d717dba9765
2017-06-29 13:18:11 +00:00
Harald Welte
250d77f8df Add loopback support for PDTCH
This add support for BTS-side lookback of PDTCH channels.

If lchan-loopback is enabled, We take the uplink frames as received in
PH-DATA.ind and put them into the dl_tch_queue for that lchan.  When we
receive PH-RTS.ind, we dequeue frames from that queue and transmit them
in downlink. If no frame is found in queue, we transmit an empty
(all-zero) frame of 23 bytes (CS-1).

Change-Id: Idd07a3f4a88c38398d3e844333c0104e2de23864
2017-06-28 23:43:28 +00:00
Harald Welte
53ce11ab95 TRX: Use timerfd and CLOCK_MONOTONIC for GSM frame timer
using gettimeofday() is not suitable for the GSM frame timer, as it
relies on the normal 'wall clock' system time, which may be adjusted by
ntp, gps or other means at runtime.

Switching to a different clock source means we cannot use
osmo_timer_list anymore, but timerfd integrates just fine with our
libosmocore select() loop handling.

Change-Id: I51b19adde14ebb7ef3bb863d45e06243c323e22e
Closes: #2325
2017-06-28 23:43:28 +00:00
Philipp Maier
59d0c2cca6 octphy: remove log output
When handle_ph_data_ind() runs BER and RSSI is logged. Remove
this log output by removing the call to dump_meas_res

(Patch by Octasic Inc.)

Change-Id: I5e755465daa3daec2e2b4f61bc8d779c49196e9a
2017-06-28 13:21:51 +00:00
Philipp Maier
5047fbe3b8 octphy: initalize nmsg only when needed
nmsg is initalized every time the function runs, even when it
is not needed. Move the initalization into the if (msg) body
so that nmsg is only initalized when we really need it.

(Patch by Octasic Inc.)

Change-Id: If51dc50a9f4bdb4aba62c0ae5fbfac552806f0c0
2017-06-28 13:21:51 +00:00
Philipp Maier
521ab50dcc octphy: initalize l1msg and only when needed
l1msg is initalized when the variable is declared. This means
the allocation always runs right on the beginning. Even when
the buffer is not needed at all.

do a prober l1msg initalization only when needed and check the
return code.

(Patch by Octasic Inc.)

Change-Id: Ia71d49b9cc109af53d997a687a7fb1b5ed062d1c
2017-06-28 13:21:51 +00:00
Philipp Maier
ae7ece1064 octphy: improve log output
Printing the RX payload size is strictly informative, so the
loglevel LOGL_ERROR is wrong. This commit changes it to
LOGL_DEBUG

(Patch by Octasic Inc.)

Change-Id: I712cdd79cbba93f457705d38871bd8d4b7f4e897
2017-06-28 13:21:51 +00:00
Max
4962ed1811 RSL: receive and send multiple SI2q messages
* change BCCH Info handler to explicitly support multiple SI2quater
  messages sent from BSC
* change SI scheduler to send SI2q in round-robin way

That's resubmission of 340cff51f4 and
186c6bac07 with memory initialization
order change to fix the issue detected by osmo-gsm-tester - see OS#2338.

Change-Id: Ib595733cde108387bc7ee76b1b11ada6a235f13c
Related: OS#1660, OS#2338
2017-06-28 07:56:32 +00:00
Philipp Maier
d0846651a3 measurement: improve log output
The code that receives the uplink measurement data from L1 does not
print the number of already received uplink measurements. Since
this is a valuable information when debugging the log output will
now print this information as well.

(Patch by Octasic Inc.)

Change-Id: I79926f25de088571fcc2c14388c72fc968c2d382
2017-06-26 13:48:10 +00:00
Max
620bd83b12 Add missing include for abis.h header file
This fixes compilation warning:
implicit declaration of function ‘abis_bts_rsl_sendmsg’

Change-Id: I956561b2f953c7d380a26442fad84bc8262ea129
2017-06-26 10:54:28 +00:00
Minh-Quang Nguyen
2a4c5fa2b3 LC15: properly handle BS-AG-BLKS-RES as received from BSC
Closes: OS#2014
Change-Id: Icf437e621d1991f6185e31a0953773309e2bf5ac
2017-06-24 12:56:08 +02:00
Harald Welte
4699ebaa26 l1sap: if lchan is in loopback, don't accept incoming RTP
When the lchan is in loopback mode, we loop back all uplink blocks into
downlink blocks.  We do not processs any RTP frames for that lchan
anymore.  Rather, we discard those RTP frames to avoid mixing
looped-back samples with those received from remote.

Change-Id: I29ef4963e9c491c94c413cbc10436a2388c04d9b
2017-06-24 12:56:08 +02:00
Harald Welte
7a6b178fc0 osmo-bts-sysmo/l1_if.c: PH-DATA.ind belongs to L1P, not L1C
L1C is control, while L1P is data primitive.

Change-Id: I5a0ef08df96a67cd25b11eb23c60934011b01c29
2017-06-24 12:56:08 +02:00
Harald Welte
53216b5d1f l1sap.c: Factor out function to limit message queue
Change-Id: I0fe0fc6b17cefdbf6b2d9f30ed08306998d30687
2017-06-24 12:55:11 +02:00
Harald Welte
50f8165540 measurement: Remove dead code
We used to have trx_meas_check_compute() and call that from the
bts-specific code in order to iterate over all timeslots and all lchans
in the timeslots if we have to send measurement reports.  This was
executed once per frame, and created unequal CPU load over time, which
in turn might increase different per-ts jitter.

Since 2f028c4e2c in April 2017 we have
lchan_meas_check_compute(), which performs this on a per-lchan basis,
and hence CPU load is distributed over all active timeslots.

Change-Id: I6308cefe4a51e55719ea4ed4d613d3782b805c08
2017-06-24 12:55:11 +02:00
Neels Hofmeyr
61f9158eaf Revert "RSL: receive and send multiple SI2q messages"
This reverts commit 340cff51f4.

osmo-gsm-tester detected a regression due to this commit, when running
osmo-bts-trx. The modems timed out when waiting for them to register with the
osmo-bts-trx network. osmo-bts-sysmo is apparently not affected. No further
details on the failure cause are known yet. The failure is shown for example by
http://jenkins.osmocom.org/jenkins/view/osmo-gsm-tester/job/osmo-gsm-tester_run/868/

Change-Id: I15bca30ddc09a7a3044096626016f6130d07636c
2017-06-24 00:49:26 +02:00
Neels Hofmeyr
1ba0cfe9c0 Revert "RSL: check for abnormal SI2q values"
This reverts commit 186c6bac07.

osmo-gsm-tester detected a regression due to commit
340cff51f4, which above commit apparently depends
on. Revert this along to avoid conflicts.

Change-Id: I456e9add788393ca781213cef31b5bc3d48fd531
2017-06-24 00:48:23 +02:00
Max
9d294c9cb1 lc15: fix jenkins build
* use proper fw headers include path
* do not quote $PARALLEL_MAKE variable

Change-Id: Ib67305ae858ce322f7ea4ac6c6ce5007ce8e7ab9
Related: SYS#3682
2017-06-22 19:51:02 +02:00
Max
5466ff9c1b lc15: make jenkins helper executable
Change-Id: Icf06040d77180fb9d877ca52e00171b21b634ef8
Related: SYS#3682
2017-06-22 13:22:43 +02:00
Max
94bdcfd803 OML: move BTS number check into separate function
* move code which checks for BTS number (obtained via OML) validity into
  separate function
* adjust log messages to match the check
* add spec reference and comments

Change-Id: Id5714fbed910696d30e18d1f20f4c9fced4b9230
Related: OS#2317
2017-06-22 10:51:12 +00:00
Max
114293a414 Copy sysmobts.service to osmo-bts-sysmo
This way the name of systemd service file will match the name of the
binary similar to lc15. Add aliases so the user can use both old and new
names regardless of which file is installed. Once the corresponding
changes to OE recipes are applied old file can be removed.

Based on work by Pau Espin Pedrol <pespin@sysmocom.de>

Change-Id: I08615eb625d488603aeb5962ad9f30869c0e77c5
2017-06-22 10:50:00 +00:00
Max
d4806db1e5 Use generic L1 headers helper
Change-Id: I2253df3509595d7393ec6631ef846dbebae73ca4
2017-06-21 20:25:28 +00:00
Max
71ad40c647 lc15: add jenkins helper
Add jenkins build helper for lc15 and separate header with BTS-agnostic
functions.

Change-Id: Ib47f5a6cc88e784c5662b0dab4ddc03ce9a35132
Related: SYS#3682
2017-06-21 20:25:28 +00:00
Max
5b87144f91 Move common steps into common jenkins helper
Move value_string termination check and OpenBSC headers checkout into
shared jenkins helper from BTS' model-specific helpers to get rid of
copy-pasted code. While at it - also remove unnecessary bash
dependency.

Change-Id: Ic48b1f75179b9008d65219dd5a47c1ab3b886408
2017-06-21 20:25:27 +00:00
Max
d5971d0681 Move parameter file opening into separate function
* use talloc for file path allocation
* print detailed error on failures

This simplifies troubleshooting of lc15bts-mgr failures.

Change-Id: I86c93a2a4f080e8ac1517be93f58f6ffd00d248c
Related: SYS#3686
2017-06-19 08:34:41 +00:00
Max
aa5edff477 lc15bts-mgr: use extended config file example
Change-Id: I0ef9d00a031b7d7e59150a28a6972c620ff19e92
Related: SYS#3686
2017-06-19 08:34:23 +00:00
Harald Welte
f4544573f8 OML Add osmocom-specific way to deactivate radio link timeout
In some situations (e.g. when trying to do measurements/testing on the
BTS receiver / uplink) it is useful to have a way to disable the radio
link timeout and keep any channel open until deactivated, irrespective
of whether (valid) data is received or not.

This adds a related feature that can be activated by using an
osmocom-specific value of 0xff for the TS 12.21 Connection Failure
Criterion (9.4.14).

Change-Id: I736f21f6528db5c16fa80cdb905af20673797be5
2017-06-18 10:00:43 +00:00
Max
186c6bac07 RSL: check for abnormal SI2q values
Check for impossible index and count values of SI2q messages. The limit
is defined in 3GPP TS 44.018 Table 10.5.2.33b.1

Change-Id: I351f8e8641a1cb9548154803da70bfde46ee180d
Fixes: CID 170749
2017-06-16 20:17:37 +02:00
Max
340cff51f4 RSL: receive and send multiple SI2q messages
* change BCCH Info handler to explicitly support multiple SI2quater
  messages sent from BSC
* change SI scheduler to send SI2q in round-robin way

Change-Id: I3aeb90804edab1b0325c3eb7347526ae995dbf51
Related: OS#1660
2017-06-15 19:18:47 +00:00
Vadim Yanitskiy
0b7a3e9f62 scheduler_trx.c: strip unused variable
Change-Id: I870dad2a00f68cca1c31a719221fc30a07b30c20
2017-06-15 14:40:21 +00:00
Vadim Yanitskiy
0227e4d04c cosmetic: fix some typos
Change-Id: Ib9172735bc7a05d9d7425a0e66dd90ff2569ee05
2017-06-15 14:40:21 +00:00
Max
61d36212b1 Cleanup SI scheduling
* use GSM_BTS_HAS_SI() from OpenBSC instead of local copy
* arrange GSM_BTS_HAS_SI() checks to improve readability
* constify SI scheduler parameters

Change-Id: If74bc536fe7d2bfbc976c07d882151873ecda4f2
Related: OS#1660
2017-06-15 13:22:12 +00:00
Max
de9357251c Set and report BTS features
Set (possibly incomplete) list of BTS model-specific features and report
them in response to attribute request via OML.

Change-Id: I5f8a6681c3562ec261441e84dde6e085b516d92f
Related: OS#1614
2017-06-15 12:55:16 +00:00
Max
b7793ed8fd Extend Get Attribute responder
* detect if attributes are requested for BTS or TRX and act accordingly
* report TRX phy version

Change-Id: I9f72305bbf1ab74745bffac1bee9f539f5a6de32
Related: OS#1614
2017-06-15 12:55:16 +00:00
Max
1dcbee3420 lc15: add example systemd service file
Change-Id: I923b4220f98bb7bd9ec78a6804bdfa9ad988f473
Related: SYS#3686
2017-06-14 13:15:45 +00:00
Max
78a5073dfb Place *-mgr config examples according to BTS model
* copy sysmobts-mgr.cfg to sysmo/ directory
* add lc15bts-mgr.cfg

The configuration is BTS-specific so it should be located inside
appropriate subdirs.

Note: the old copy of sysmobts-mgr.cfg can be removed once the image
build recipes are adjusted.

Change-Id: Ic81197464809ba508b2572e86dd978a994f4b116
Related: SYS#3686
2017-06-14 13:15:42 +00:00
Max
16b8f51839 Use systemd template specifiers
Use systemd template specifier for config name instead of hardcoding
it. This will allow to specify different config file name depending on
the name of the service file.

By default sysmobts-mgr.cfg will be used preserving compatibilty with
existing installations but if the unit is named lc15bts-mgr.service than
lc15bts-mgr.cfg will be used. This gives us necessary flexibility to use
BTS-specific configuration.

Change-Id: I475df6a06691390120eea0bd8a61fa469df2bd2d
Related: SYS#3686
2017-06-14 13:32:11 +02:00
Philipp Maier
0e7886d379 measurement: Improve log output
The debug log does not print much information about the measured
rxlev and rxqual values. This commit adds debug output to make
measurement debugging simpler

Change-Id: Ic871eed6dcbc7d10aca6cd11dbc803b3e6da449f
2017-06-13 10:06:24 +00:00
Philipp Maier
3e2de526b0 cosmetic: remove unused variable
Tha variable ms_timing_offset in lchan_meas_check_compute is not
used anymore.

Change-Id: I40c393f6864fe72b88a70da265b7775da8fb469c
2017-06-09 16:09:21 +02:00
Philipp Maier
88b2cc30a6 sysmobts: normalize frame number in measurement indication
The higher layers relay on a normalized version of frame number
in order to detect the end of a measurement period.

The frame number on which the measurement reports are sent may
depend on the phy, so we need to normalize the frame number
before we report it to the higher layers.

Change-Id: I90bd01479e41f04a6b0aefe3845d071e3148d0c6
2017-06-09 16:09:21 +02:00
Philipp Maier
67d3b8b136 Revert "measurement: exclude idle channels from uplink measurement"
The offsets used in the lookup tables may be phy dependand. So we
will have to do the alignment in the layer 1 interface of the
phy dependand code before we report the frame number up to the
higher layers.

This reverts commit e0fb3ae52d.

Change-Id: I8acab50cc1bb1cb133831c6a145f4d790e99176c
2017-06-09 16:09:21 +02:00
Philipp Maier
95d2505e57 octphy: fix segfault
The priv pointer of the callback function app_info_compl_cb() is
set to null by the pointer. It should be set to pinst instead.
Besides of that there is a memory violation while accessing
the local variable ver_hdr using osmo_strlcpy(). Both is fixed
with this commit.

Change-Id: I558d78ef29e9a4d8f45f4142611f11289d3ed806
2017-06-09 16:09:21 +02:00
Max
d22b5b84c0 Re-add version to phy_instance
This is resubmission of 9eeb0b1a13 with
errorneous use of talloc_asprintf() removed which should fix OS#2316.

Change-Id: I02ae6fffdc808c1ea14185dbb4a720d27a62d4bb
Related: OS#1614
2017-06-09 09:00:04 +00:00
Philipp Maier
d5fdcfe6d9 measurement: fix measurement computation
Timing advance is currently not taken into account when computing
the measurement results, this commit fixes that

Change-Id: I2e0dfd13b53e8aa2822985f12bf2985e683ab553
2017-06-09 08:54:54 +00:00
Pau Espin Pedrol
e3a3906ee9 trx: Save osmotrx base-port vty properties
Change-Id: I0898a8c4eb3899fc1c0f6b17da33b8c7851b90d6
2017-06-06 19:48:53 +00:00
Pau Espin Pedrol
8a8d73a691 trx: Allow BTS and TRX to be on different IPs
Depends on libosmocore I3c655a4af64fb80497a5aaa811cce8005dba9cd9

Change-Id: I0bd34b7b02c1a9b0c6f6f89f327b486e5620c8d5
2017-06-06 19:23:18 +00:00
Neels Hofmeyr
d36b3a8463 Revert "Add version to phy_instance"
This reverts commit 9eeb0b1a13.

This commit caused osmo-gsm-tester test runs for the sysmoBTS to fail with
SIGABRT consistently. See below redmine issues.

In osmo-bts-sysmo/l1_if.c, it uses talloc_asprintf to write to the char
version[MAX_VERSION_LENGTH]; talloc_asprintf() however is intended to work on
string buffers allocated by talloc, and attempts to reallocate version[].

Furthermore, it is not clear why the patch passes a 'data' arg to
app_info_sys_compl_cb() that is not used.

Hence I will revert this instead of trying to fix. Please resolve issues and
re-submit.

Related: OS#2316 OS#1614
Change-Id: I2c9fd5e6739c1750365c0241476ce4b1aa2df3d4
2017-06-02 22:46:16 +02:00
Max
e91cd2b088 OML: fix Coverity-reported issues
* CID 169803:  Null pointer dereferences
* CID 169802:  Incorrect expression

Change-Id: Ib3f91be97c8bf81a87681814bf81d3a5a9950e54
Related: OS#1614
2017-05-29 21:13:45 +00:00
Max
9eeb0b1a13 Add version to phy_instance
Change-Id: I5b2352b8d15e9b0d8616fcd526b4902d247e4693
Related: OS#1614
2017-05-29 21:13:45 +00:00
Harald Welte
a8bf666a09 sysmobts: Re-order the bit-endianness of every HR codec parameter
The so-called "RTP mode" of the DSP contains a bug on all firmware
versions < 5.3.3 which causes the bit-order within each of the
non-aligned codec parameters to be wrong.  Introduce a function
originally written by Sylvain Munaut during 32C3 in
http://git.osmocom.org/openbsc/commit/?h=sylvain/32c3_codec&id=5b4a16bbe93a7b1ace65cc23d6cce56ecf4f1275
to bring the bits into [the correct] order.

This has never been seen in a "pure sysmoBTS" setup, as all BTSs would
use the same (wrong) bit-ordering and thus interoperate.  This patch now
checks for an affected DSP firmware version and then jumbles (old DSP
firmware version) or does nothing (new DSP firmware version).

Change-Id: Ia0eee4f514fb8fd81c052bb44a4facba898d6afb
Closes: SYS#2452
2017-05-29 21:58:51 +02:00
Harald Welte
cb5a969a45 l1_if: Add inline functions to check dsp/fgpa version at runtime
Change-Id: Iddae9c8de33aca6663dca77908fa4852ad704ce9
2017-05-29 21:58:51 +02:00
Harald Welte
450714b19c vty: Remove command for manual channel activation/deactivation
OsmoBTS won't run without being connected to a BSC.  The BTS wouldn't
start to transmit if the BSC doesn't properly initialize it.  So if we
want to activate some channels manually for testing, we should do so
from the BSC, and not inside the BTS code.  Doing this in the BTS means
that the BSC is not aware of it and might want to use that channel for
something else meanwhile.

Osmo{BSC,NITB} has gained ability to manually activate a channel from
the VTY in Change-Id I44fc3904678eb48bd3ab1a3da8c0c265fa082e0d as can be
seen at https://gerrit.osmocom.org/2759

So let's remove the old/obsoleted code here.

Change-Id: I7ba0301b55cc283aa6a441899f84357e28a97321
2017-05-29 21:58:51 +02:00
Harald Welte
43c763f5af osmo-bts-trx: Remove duplicate parsing of NM_ATT_CONN_FAIL_CRIT
For some reason, osmo-bts-trx did another take at parsing
NM_ATT_CONN_FAIL_CRIT and storing the second octet in
btsb->radio_link_timeout, just like the generic code already does in
oml_rx_set_bts_attr(), but without proper checking and any error
message.  Let's remove it.

Change-Id: Idb0179e1443c0b5a97e59919dba684a001e90192
2017-05-29 19:55:30 +00:00
Harald Welte
440930be44 l1sap.c: Add spec reference to link timeout implementation
Change-Id: Ia95635a4350624b30f2b352e30ee39f856945670
2017-05-29 19:55:30 +00:00
Harald Welte
05ba5c2a10 Consistently check for minimum attribute/TLV length in RSL and OML
Make more use of TLVP_PRES_LEN() instead of plain TLVP_PRESENT() and
implicitly assuming a certain length of the information element.

What this obviously doesn't introduce is some kind of error
generation/reporting in case the minimum length is not fulfilled.  An IE
that's too small is silently ignored by TLVP_PRES_LEN() and treated as
if the IE wouldn't exist in the first place.

Change-Id: If5c4eee65711c49bc8ba4675221b1d5fd16198e9
2017-05-29 19:55:30 +00:00
Philipp Maier
3f97e4b1fc osmo-bts-sysmo: Include frame number in MEAS IND
l1_if.c does not generate struct osmo_phsap_prim l1sap properly.
The (logical) frame number is not included in this struct. This
renders the logic that processes the reported measurements non
functional, since the logic (see measurement.c) is no longer
able to detect the end of the measurement period.

This commit fixes the problem by adding the missing frame number
to the l1sap structure.

Change-Id: I2bab40c30d727395eb3096026810917407419cd7
2017-05-29 18:18:31 +02:00
Philipp Maier
538475259c octphy: remove old event control code
Event handling is done internally in the Octasic BTS. When the TRX is opened,
events are enabled automatically and when TRX is closed events are disabled.

The change is valid for the recent firmware version and for the last couple
of previous releases.

Change-Id: I0652627495f6a9bcb0da2431b8beb839bc22062b
2017-05-29 11:11:36 +00:00
Philipp Maier
524e3e3170 octphy: integrate channel measurement handling
recent octphy firmware versions do support proper channel measurement handling.
The new implementation replaces the old, and for osmo-bts non functional
implementation.

This commit introduces the necessary adjustments. Older firmeware releses will
still work. However, the measurement computation results will still be wrong.

Change-Id: I0f053bb10b1cb112a8814ee591969d607888e686
2017-05-29 11:11:35 +00:00
Harald Welte
ed9e022eb4 rx_tchh_fn(): Avoid copy+pasting formula to determine odd-ness of fn
Change-Id: Ic2a0bdaa70cc28c1ce8237351b0a0c6b998cf0a3
2017-05-27 08:24:05 +00:00
Harald Welte
a493ce9e66 scheduler_trx: Avoid copy+pasting determining CMR from FN
instead, let's introduce a specific function for that.  Also, as this
can be easily determined from the frame number, skip one argument to
tx_tch_common().

Change-Id: Ibbb9b685cf0b6a45339b0874438a500dd6254bc2
2017-05-27 08:24:05 +00:00
Harald Welte
031e8fedac scheduler_trx.c: Avoid code duplication for BER10k computation
Use an (inline) function rather than code copy+pasting

Change-Id: I42e76a4707968e428cbd2e43d5df71ef445efece
2017-05-27 08:24:05 +00:00
Harald Welte
b4c9c8f35d scheduler_trx.c: Fix typos, improve comments, cosmetics
Change-Id: I5e2ce70aea8d62657ce3a7d6c16e5a7f8b76c22f
2017-05-27 08:24:05 +00:00
Harald Welte
ed51c3d145 Remove unusued left-over gsm0503_conv.c
gsm0503_conv.c should have been removed as part of
efbef50efc but somehow was left here. It's
not referenced/compiled by the Makefile anymore, and the gsm053_conv.c
in libosmogsm has superseded it anyway.

Change-Id: Icdcca1bc55a83c76ec47918dc4dd301155210091
2017-05-27 08:24:05 +00:00
Max
72993079ed Implement basic Get Attribute responder
Add 3GPP TS 52.021 §8.11.2 Get Attribute Response handling:
* report OsmoBTS version
* report sysmoBTS sub-model
* report OsmoBTS variant

Requires I7ecb0c4339530d3a8354a2f94b34063dda87e030 in OpenBSC.

Change-Id: I09f95ed995fab5def9dc6e8cc201012fba4db28d
Related: OS#1614
2017-05-27 07:55:41 +00:00
Philipp Maier
e0fb3ae52d measurement: exclude idle channels from uplink measurement
The DATA-IND, received from the physical layer does not only include the actual
uplink data. It also includes the frames which are received when the channel
is idle (which is just noise). This would falsify the measurement results.

Depending on the BTS model, the phy may also filter the idle frames and not
send a DATA-IND at all, when the channel is idle. If this is the case, the
measurement period end can not be detected properly.

The idle frames are located at the very end of each measurement period. In
order to fix the issue, the measurement perioud has to end early. For TCH/F and
TCH/H 1, one frame has to be skipped. For TCH/H 0 two frames are skipped.

Example: For a TCH/F in TS0, the Measurement perioud would end at frame number
103. However, 103 is reserverd as idle frame. So we need to detect the end of
the measurement period at frame number 103 (-1).

Change-Id: I471a767c7974bdacadc3233d0c3e7b7965f6eafa
2017-05-24 22:19:02 +00:00
Pau Espin Pedrol
27b022e0c4 phy_link: Fix typo in state being printed
Change-Id: I312eefa6738f8abdeedd2efb574f3e45cd2e8aa3
2017-05-24 19:26:48 +02:00
Max
3aeb9301f4 Remove redundant test
After switching to libosmocoding there's no need in low-level bursts
test which is part of libosmocoding anyway.

Change-Id: Icb8caf62ac653a39a7a82f2225e8edeab7f5afb5
2017-05-22 09:37:27 +00:00
Max
efbef50efc osmo-bts-trx: use libosmocoding
Remove built-in functions and use libosmocoding instead.

Change-Id: I1b41bb1a8de655639107ec1f3b75afc240fd316f
2017-05-22 09:37:26 +00:00
Philipp Maier
9c1d3f9606 measurement: Compute measurement results on measurement idication
Computing the measurement results on in l1sap_info_time_ind() all
at once may peak the host CPU. On smaller systems (arm based
sysmobts) this might cause a noticable delay of other important
tasks (e.g. passing l2 messages back and forth) It makes more
sense to compute the measurement results continously when
l1sap_info_meas_ind() is executed.

Change-Id: Iecb9a30c0d716bfc88221cd752b1ffdc74269e30
2017-05-17 18:56:51 +02:00
Philipp Maier
2f028c4e2c measurement: make lchan_meas_check_compute() available to l1sap.c
lchan_meas_check_compute() is a static function measurement.c.
In order to distribute the measurement result calculation events,
we need to be able to call lchan_meas_check_compute() from l1sap.c

Change-Id: Ideffe896613e0feda443bc13dac59dcdbbc605aa
2017-05-17 18:56:51 +02:00
Philipp Maier
67d8c72c2e measurement: fix measurement reporting period
The measurement reporting for the MS on a SDCCH lacks some of
the periods, defined in 3GPP TS 45.008, section 8.4.2. This
adds the missing conditions by adding complete lookup tables.

Change-Id: I23fba50f48415314da40cf5bf86fce2ed3e66af6
2017-05-17 18:56:24 +02:00
Philipp Maier
b16eed22c7 octphy: ensure that 11 bit rach flag is not set
The l1 interface does not explicitly set the flag for 11 bit
rach when a rach request is received. Since the current and
previous octphy firmwares do not support 11 bit rach requests,
the flag should be explicitly set to zero.

Change-Id: Ifa165c56e54d272caafa45d1bf0e177848fcdfbd
2017-05-17 16:22:27 +02:00
Philipp Maier
2c841100a9 octphy: align frame number for new firmware versions
Firmware releases OCTSDR-2G-02.07.00-B1314-BETA and newer require
to align the GPRS frame number (fn-3) for ph_data indications.

To preserve compatibility the header version is checked during
compile time and the right method is compiled in.

Change-Id: Ib93d5fb3b34ff92f10021a0e9ce9c8aa3044b7ff
2017-05-17 16:22:27 +02:00
Philipp Maier
17a09507b8 octphy: activate CBCH after all physical channels are activated
CBCH is activated when the SAPI for TS0 is activated. Since the CBCH can be
configured on any physical TS, we wait until all (TS7 is the last) physical
timeslots are configured.

Change-Id: Ie307bf9f370a346686e3bd8c8a8483953a1bc279
2017-05-17 16:22:27 +02:00
Philipp Maier
e3de64cd67 measurement/cosmetic: Fixup source code comment
the function is_meas_complete() uses the *_meas_rep_fn104[]
lookup tables, defined at the beginning of the source file.

These lookup tabels contain a lot of magic numbers. This
commit adds a more elaborated comment with a reference
to the specification/section in order make the values
understandable.

Change-Id: Ic6e4037f965772e6b851c67662d5e7bf64cc04eb
2017-05-17 14:42:00 +02:00
Philipp Maier
22704a88e2 measurement/cosmetic: Fixup source code comment
the function ber10k_to_rxqual() has only a very brief
comment with the spec reference. This commit adds a more
explainatory comment that makes it easier to understand
from where the ber10k constants are taken.

Change-Id: I3d3488c97d0bffa7d449d3675afcc75b2a6a2703
2017-05-17 14:41:52 +02:00
Max
2d848a061e Prepare for BTS attribute reporting via OML
* move BTS model name resolution into separate function
* add convenience wrappers for BTS type and number fo TRX and use then
  in L1 interface

Change-Id: I4649100df8f1b8e095f210fc294567ba014c0b6a
Related: OS#1614
2017-05-15 08:12:15 +00:00
Max
8913b29be2 Set BTS variant while initializing BTS model
This will allow proper BTS attribute reporting via OML in follow-up
patches.

Change-Id: I1c49d6c39fb4dac7a46ee25ceacf4c6ef0f0b736
Related: OS#1614
2017-05-10 07:50:00 +00:00
Vadim Yanitskiy
028820510e osmo-bts-trx/l1_if.c: cosmetic: drop double check
Change-Id: I25a8f85ee65e1c0dd54049ffacc039702ca36c8f
2017-05-09 22:18:19 +00:00
Max
9563039a2a Prepare for extended SI2quater support
SI2quater support as per 3GPP TS 44.018 will require chnages to the way
System Information is stored because it uses 1:n instead of 1:1 mapping
between SI type and generated SI content. This should not affect other
SI types though. To facilitate this transition:

* convert the code to always use GSM_LCHAN_SI helper instead of
  accessing buffer directly
* move duplicated code to inline function
* add logging for buffer truncation and corresponding length values

Requires I74e4e3cb86364cec869a1472a41b4a95af0d50dd in OpenBSC.

Change-Id: Ie97be6ead6ce6d2d425fbfac8429bb90afb95acc
Related: RT#8792
2017-05-09 09:10:45 +00:00
Max
9d5ec1af74 Signal to BSC when PCU disconnects
While at it - do not serialize NULL as a string when delivering OML
Failure Report.

Change-Id: I41a731bd719aee0bbb98d3236405fb3a7f3ddec0
Related: OS#1615
2017-05-08 08:31:52 +00:00
Philipp Maier
91685096f8 bts: revert trx shutdown order
When a new TRX is allocated using gsm_bts_trx_alloc() (see gsm_data_shared.c in
openbsc.git), than it is added to the list in order. When octphy is shutting
down the BTS, it uses llist_for_each_entry() to iterate the tansceiver list to
shut all transceivers down. This means it starts the shut down process with
the primary TRX and then continues with the secondary transceivers in order.

However, octphy does not allow to close primary TRX if the secondary TRX is
open. The shutdown sequence must begin with the secondary transceivers and
finish with the primiary transceiver as last item.

The problem can be easily fixed by iterating the transceiver list in reverse
order using llist_for_each_entry_reverse() instead of llist_for_each_entry()

Since this is a change in the common code, all BTS models (not only octphy)
are affected, but from the logical perspective, this change makes sense
for all other BTS models too.

Change-Id: I18485de586b402610f9e98053d69e92bc9b18dc2
2017-05-08 07:46:25 +00:00
Holger Hans Peter Freyther
40dca8f991 sysmobts: Store a simple network config in the EEPROM as well
Make it possible to store:

	* Static vs. DHCP mode
	* IPv4 address
	* Netmask
	* GW IPv4 address
	* DNS IPv4 address

Add a simple CRC8 and pick 0xFF as initial value so an all
zero EEPROM will not generate a 0 CRC. The code tries to
differentiate exit code between unreadable EEPROM and CRC error.

This is a reference to see if we want to have store it in the
EEPROM or not.

Change-Id: Id8a37fe952ef2a8ef36778729f506f900accf8d1
2017-04-30 21:45:08 +00:00
Holger Hans Peter Freyther
d62a58dbfb sysmobts: Make reservation for mode/netmask/ip and suc
Change-Id: Ib98856356dc296be9e449d35479bc9234c0c4d32
2017-04-29 11:56:29 +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
Jean-Francois Dionne
fce5b31b94 Fix RTP duration adjustment not done when speech resumes in DTX mode.
RTP jitter increases continuously because duration is not
updated when speech resumes in DTX mode.

Change-Id: Ib51ed95a449369222c957b3acebd9ce1f66c5435
2017-04-27 10:14:59 +00:00
Max
b4bf603c98 Add MS TO to RSL measurements
Add optional MS timing offset (3GPP TS 45.010 § 1.2) to RSL MEASUREMENT
RESULT (3GPP TS 48.058 § 8.4.8). The value is calculated either directly
from corresponding BTS measurement or from 3GPP TS 48.058 § 9.3.17
Access Delay (for known TA) and is invalidated after RSL report is sent
until new measurement indication or RACH is received.

Change-Id: I4dfe5c48834a083e757d5de3236a02e15a238b28
Related: OS#1574
2017-04-26 12:42:09 +02:00
Philipp Maier
25742a5929 octphy: set tx/rx antenne IDs via VTY
add support for the TX/RX antenna-id feature that has been
introduced with release OCTSDR-2G-02.07.00-B1314-BETA. The
user can now set individual ID numbers for the TX and for
the RX antenna.

Change-Id: I872fe3c4d7b593358a4ce2f02cf0726611b9f3aa
2017-04-13 19:08:47 +02:00
Philipp Maier
e4403464ed octphy: add conditional compilation to support latest octasic header release
With octasics latest release (octsdr-2g-02.07.01-B1351-beta), some struct
members are moved or renamed. This patch adds ifdef-logic and configure
checks to restore compatibilty.

Change-Id: I73287983e8bed8bf64b2ab87e6b810c2c59ea6fd
2017-04-13 19:03:56 +02:00
Philipp Maier
7a21dccec1 octphy: display hint in case of wrongly configured transceiver number
Making use of the multi-trx feature requires to tell osmo-bts that
more than one transceiver are available. Otherwise it will complain
that not enough transceivers are available. This can be quite
confusing, even a correct config file will fail to parse if it
specifies more transcrivers than available.

This patch adds a hint to the error message so that the user knows
that he should check the -t commandline option

Change-Id: Ifbeacd9d43f7c6cd74a1e1b33288e66828fe843f
2017-04-13 19:03:56 +02:00
Philipp Maier
d040bf97de octphy: print log message for multi-trx support
Some header file versions support multi-trx and some do not. After
to compiling it is very difficult to find out if the binary is
multi-trx capable por not. This patch adds a log line that should
rule out any doubts.

Change-Id: I257c0a5e7c5ff5df2f0a603d1ede6db5679382e0
2017-04-13 19:03:44 +02:00
Philipp Maier
1fde15c8bd l1sap: improve log output
Print toa and ra value with the "RACH for packet access" log
message.

Change-Id: I3a2dde95947438aa8348a0a9fc8566cbc177aa2d
2017-04-13 19:02:46 +02:00
Philipp Maier
8e7a51d8c3 octphy: add CBCH support
add Support for CBCH channels in osmo-bts-octphy

Change-Id: Ic5c8363b4dd8ba78ab22bd5527c08d1162331540
2017-04-13 19:02:29 +02:00
Philipp Maier
416ee3ec89 octphy: fix usage of wrong define constant
octphy_hw_get_rf_ant_tx_config() uses define constant
cOCTVC1_HW_MSG_RF_PORT_INFO_ANTENNA_RX_CONFIG_CID instead of
cOCTVC1_HW_MSG_RF_PORT_INFO_ANTENNA_TX_CONFIG_CID. This commit
replaces exchanges the wrong constant with the correct one.

Change-Id: Ie4de23daf79bb07ca0c0b818eefe350d18d27e4d
2017-04-13 19:02:07 +02:00
Max
dafb363533 Handle TXT indication from OsmoPCU
* handle OML message
* handle OsmoPCU version message
* show stored PCU version in 'show bts ..' vty command

Requires OpenBSc with I6710d53115f34634a7b70969cc05fd5c72ff8ab2.

Change-Id: I16e73198501487a5b1076bf83390b85538d5af73
Related: OS#1614, 1615
2017-04-10 06:57:39 +00:00
Harald Welte
bbe90fd651 sysmobts: Don't start with 0dBm TRX output power before ramping
In case a system has a high-gain external PA (like a 40dB PA) connected
externally, we cannot simply switch the transceiver to 0 dBm in
trx_init() only to then start the ramping at much lower levels once the
PHJ completes in trx_init_compl_cb().  The result would be a short
0 + 40 dBm spike followed by later ramping.  We want to avoid that
spike, particularly its associated inrush current, so let's bring up the
board with smething very conservative like -50 dBm, and then ramp from
there.

Change-Id: I0ad91fce64f65e0213c9fcfde3390ace519055db
Fixes: SYS#3259
2017-04-06 18:41:01 +02:00
Max
e16b593574 vty: reduce code duplication
Use libosmocore's osmo_str2lower() instead of local equivalent.

Change-Id: I7faced2eaf0f6f87f06081235eea9d4c3ba71a7e
2017-03-23 13:08:39 +01:00
Vadim Yanitskiy
957843959d osmo-bts-trx/l1_if.c: use channel combination III for TCH/H
Currently the channel combination II is used for TCH/H, which
allows only one lchan to be allocated. The reason is that it
saves a bit of CPU by disabling UL burst detection on lchan 1.

There is also the channel combination III, which allows to
increase channel capacity, providing two lchans on a single
TCH/H timeslot.

Ideally we should implement some dynamic II <-> III switching
depending on the network load level. But for now this change
replaces the channel combination of TCH/H by III, until dynamic
switching is implemented.

Fixes issue: https://osmocom.org/issues/1795

Change-Id: I8fd4abb42c153fcd26bcfe22a2554b5c2d02d810
2017-03-23 11:35:05 +00:00
Max
f4816fa577 Sync protocol with OsmoPCU
Copy-paste changes from OsmoPCU commit 0a8fae8d141c2cfa4387ffe9b35402d5b8cc85cd.

Change-Id: I15e6cc86604947a173e8675ba4b41a3bda2d3296
2017-03-23 10:04:38 +00:00
Max
a80c7024f8 osmo-bts-trx: fix scheduling of broken frames
* DTXu: don't set marker for broken frames
* do not attempt to send 0-length bursts to avoid flood of errors after
  bts startup

Change-Id: Icb536f951386b9abe34c0dacbb203f3db1e41bb3
2017-03-23 10:03:27 +00:00
Philipp Maier
b609ee879e l1sap: fix PTCCH detection
The macro L1SAP_IS_PTCCH(fn) only detects a PTCCH channel at fn%52 = 12,
the detection logic has been extended in order to detect PTCCH at fn%52 = 38.

See also 3GPP TS 05.02, Clause 7, Table 6 of 9

Change-Id: Ia6f3333121e5e920c5e1d562a081d0a1b58a1153
2017-03-20 12:36:21 +01:00
Harald Welte
f9eef0ce3e README: update some of the limitations
Change-Id: Ifec983e02ce517d4fe17d595b65312c53b0429b7
2017-03-17 17:49:12 +01:00
Harald Welte
83c4fbc2dc README: Add general project information and convert to markdown
Also, make sure README.md is included in EXTRA_DIST

Change-Id: Icd9192833e1f95758c84cad85f0f0289ff4eb32a
2017-03-17 17:35:27 +01:00
Neels Hofmeyr
f462c87581 jenkins: add value_string termination check
Change-Id: Id4eb92924c03748563921e3f56cc0e5e0ffff502
Depends: libosmocore change-id I2bc93ab4781487e7685cfb63091a489cd126b1a8
2017-03-16 19:00:39 +00:00
Philipp Maier
339b9329ff l1sap: fix rach reason (ra) parsing
The ra parameter indicates the reason for the received rach
request. osmo-bts uses the ra parameter to determine if the
received rach request is packet access related. If yes,
osmo-bts will forward the request to the PCU.

In order to determine if the ra is packet related or not,
the higher 4 bits must be equel to 0x7 and at least one of
the lower 4 bits must be zero.

The current method lacks checking of the lower 4 bits. It
would also accept 0b01111111, which is reserved for future
use. This commit extends the check to take also the last
4 bits into accound.

See also: 3GPP TS 04.08, Table 9.9

Change-Id: I5eb88c42a91e158d9bfa4105ec9636035baf8959
2017-03-15 13:37:55 +00:00
Max
9dfdf54d30 Check for suitable lchan type when detecting HO
Log error when handover RACH is detected on wrong channel: according to
3GPP TS 44.018 it can only be seen on SACCH and DCCH.

Change-Id: Iacbcc8441d6cfbb8f808948a8baddde1ebca488a
Related: OS#1898
2017-03-14 14:17:44 +00:00
Max
6f5e398ccb Handle ctrl cmd allocation failures
Check that ctrl command was successfully allocated before using it.

Fixes: CID163884
Change-Id: Id19e1ce5fae6f936c9ed93f9a6317b57d28d7311
2017-03-14 08:59:19 +00:00
Max
a1b891aab4 Remove code duplication
Use gsm_bts_trx_num() from OpenBSC instead of static function.

Change-Id: Iba80e7a12c85976981a49a9424db069fc4110373
2017-03-07 18:42:27 +01:00
Max
4acc98e68a Use oml-alert CTRL command for temp report
Send temperature reports via OML alert facility exposed by CTRL
protocol.

Change-Id: If29fbd0ab01fefc76e87b90cf1fbc81b2089ba76
Related: OS#1615
2017-02-24 15:03:37 +01:00
Philipp Maier
758522947f octphy: Fix VTY commands
The VTY commands show phy 0 rf-port-stats and show phy 0 clk-sync-stats
do not output their results on the VTY console. If one of those commands
is entered the user is prompted to view the logtext, which is an
uncomfortable solution. This commit adds the missing functionality to
print the information in the VTY as well.

octphy_hw_api.c contains two value_string structs (radio_std_vals and
clocksync_state_vals) which are now exported in octphy_hw_api.h in
order to access them from octphy_vty.c

Change-Id: Iae5aa91fe2ebba7c2874eed88b15ed66e8c9cd61
2017-02-22 10:09:32 +00:00
Ivan Kluchnikov
64d16028eb oml: Fix incorrect usage of const variable abis_nm_att_tlvdef_ipa
This bug was introduced during moving oml definitions from osmo-bts to libosmocore
in libosmocore 0bee65c0d89f81a4b90aa3d484016d9ba680dd46 and
osmo-bts 2cf6b73a42:

The type of abis_nm_att_tlvdef_ipa was changed from struct tlv_definition to
const struct tlv_definition, so:
 * create static abis_nm_att_tlvdef_ipa_local variable for oml attribute
   definitions
 * copy abis_nm_att_tlvdef_ipa to abis_nm_att_tlvdef_ipa_local
 * merge abis_nm_att_tlvdef with abis_nm_att_tlvdef_ipa_local
 * use abis_nm_att_tlvdef_ipa_local in oml_tlv_parse function

Change-Id: Ia9f3c94ab247adeecb26a01c3ccd6f3a8c17ba1c
2017-02-20 13:28:38 +00:00
Ivan Klyuchnikov
70c68853c2 osmo-trx-bts: Fix incorrect bts shutdown procedure in case of clock loss from osmo-trx
This issue occurs in case of osmo-trx restart which leads to losing clock from osmo-trx.
Function bts_shutdown from common/bts.c should be used in this case for proper bts shutdown.

Change-Id: Ie65cf2e8f98cb8bf3314a00048aa53c1f8cd4c25
2017-02-19 08:58:20 +00:00
Harald Welte
6b4c6aa375 sysmobts: fully support trx_power_params
The simplistic approach of sysmobts_get_nominal_power() is insufficient
to cope for devices that have an internal PA.  The Actual transceiver
board is driven to a certain level (0..23 dBm typically), and the
external PA must be handled independent of that.  Increasing the return
value of sysmobts_get_nominal_power() would result in the sysmoBTS
mainboard attempting to reach a higher power, which is wrong.

This change affects sysmoBTS 1020 and 1100.  It causes power-ramping to
be used by default.  For 1002 and 2050, no behavior change is expected.

Change-Id: Ieff75d5becaa80a2097b6e744c75c2d16259c9a4
2017-02-14 17:31:27 +00:00
Ivan Klyuchnikov
c4ac69dcc2 osmo-trx-bts: Fix incorrect bts shutdown procedure in case of abis connection closure
This issue occurs in case of osmo-nitb restart which leads to abis connection closure.
Function bts_shutdown from common/bts.c should be used in this case for proper bts shutdown.

Change-Id: Id025e703dd5c91896d450d200e88e46552f178f0
2017-02-14 16:50:11 +00:00
Max
b390dfb90d Fix typo in TCH/H interleaving table
According to Table 4 in 3GPP TS 45.003 j=11, b=3 case corresponds to
k=91 and not j=12 as was previously used.

Change-Id: Iad3cf545b2f7e16276466cc37dd7a1e7858467e5
2017-02-10 16:43:44 +01:00
Ivan Klyuchnikov
0418ef588c osmo-trx-bts: Fix osmo-bts-trx crash on startup during reading phy instance parameters from config file
pinst->u.osmotrx.hdl should be allocated before reading phy_instance parameters from config file and applying them.
So allocation of pinst->u.osmotrx.hdl should be moved from l1if_open function to bts_model_phy_instance_set_defaults function,
which is proper place for this allocation according to start-up procedure of osmo-bts.

Change-Id: I6e23f92644400acb268818c9373a8fb10c003da1
2017-02-10 13:37:50 +00:00
Ivan Klyuchnikov
e2e0ed5a89 osmo-trx-bts: Fix incorrect setting of RXGAIN and POWER parameters on second channel (TRX1) of osmo-trx
Move rxgain and tx-attenuation (power) parameters from phy_link layer to phy_inst layer.
Rxgain and tx-attenuation parameters should be set for each phy_inst and send for each osmo-trx channel accordingly via control commands.

Change-Id: I4861a59d10d1ef91954e0c6ea265e66dec08844f
2017-02-10 13:35:41 +00:00
Alexander Chemeris
d5414cc30e rsl: Output RTP stats before closing the socket.
It's useful to know RTP statistics (number of packets lost, jitter, etc)
when looking at voice call quality issues. Right now this information is
not avialable anywhere and this looks like the best place to start.

Change-Id: Ife9f27c43157b4a1bf71aba41cd7b0f5f41ac99f
2017-02-10 12:23:38 +00:00
Neels Hofmeyr
ae50f7dac2 cosmetic: lchan_sacch_get: early-exit instead of nested-if
Change-Id: I1fbf7d7f619cc8194c8094cf4a1826b6114f0e11
2017-02-10 12:18:49 +00:00
Neels Hofmeyr
7a18906cfa all models: fix vty write: bts_model_config_write_phy
The vty write for phy/inst is broken, leading to a written-out config being
unparsable; fix all of these:

- in common/vty.c, actually call bts_model_config_write_phy_inst().

- in sysmo and lc15 write the phy instance elements in
  bts_model_config_write_phy_inst() and not in bts_model_config_write_phy(),
  which lead to writing the members above their parent 'instance'.

- sysmo, lc15 and oct omit the bts_model_config_write_phy_inst()
  implementation. This did not cause a compilation problem because it
  was in fact never called.

- sysmo writes 'clock-source None' when clk_src is zero, leading to unparsable
  config (related: OS#1944). Instead omit the 'clock-source' when zero.

- osmo-bts-trx seems to be the only part that lacks nothing, yet it
  also didn't work properly because bts_model_config_write_phy_inst()
  was never called.
  
This problem existed since commit d784e50747
"Introduce new phy_link and phy_instance abstraction"

Change-Id: Icc54fa70045c8fa58e78cf9f788c21a437edfbd4
2017-02-10 07:27:51 +00:00
Neels Hofmeyr
d15dc832c9 SACCH SI: assert that SI enum vals fit in bit mask
In case our SI enums ever move past 31, this static assert will warn us to
enlarge osmo_si_shifted.

Change-Id: I4185d7de590329ff5f523b241721c586ffdbcd8b
2017-02-08 19:34:14 +01:00
Neels Hofmeyr
1631266993 SACCH: fix sending of SI with an enum value > 7
In copy_sacch_si_to_lchan(), the variable to hold the bit mask for SI-is-valid
was chosen as uint8_t, and as a result none of the SIs with an enum value >= 8
would ever be sent. Use int for enum value and uint32_t for the bit mask.

Fixes: #1945
Change-Id: I85fa9a50691601bcd103845c6811caa061a39824
2017-02-08 19:34:06 +01:00
Neels Hofmeyr
3c144069da fix missing ~ in bit logic for lchan->si.valid in rsl_rx_sacch_inf_mod()
Upon rx of a SACCH INFO Modify for an lchan that has no L3 INFO IE, clear only
the si.valid bit in question, instead of clearing all but the one in question.

BTW, It first looked like it could be, but is *not* the cause for OS#1945
(SI5ter never sent to MS).

Change-Id: I0df20b6643b0bfd219ce1df594075838d8406719
2017-02-08 18:00:57 +01:00
Harald Welte
69d297ce75 Add new unit-test for transmit power computation code
This tests the computations of the tx_power.c code using sysmoBTS 1002,
1020, 1100 and 2050 values, as well as the power ramping code.

Change-Id: I1cc88d4c6edff326e2e67d4f869aa02c9b2b1ac5
2017-02-07 20:33:18 +00:00
Harald Welte
df5ac9aa11 tx_power: Change PA calibration tables to use delta vales
It seems more user friendly to look at a calibration table in terms of
the delta (positive or negative) compared to the nominal gain value,
rather than a collection of absolute gain values.  It has the added
benefit that the (API/data model) user doesn't have to specify a gain
value for each ARFCN, but rather can rely on the default nominal gain in
absence of a calibration table for this specific unit.

Change-Id: I7311815902a88d2fc9d211cf4c62fa6fdc5e86ad
2017-02-07 20:17:27 +01:00
Harald Welte
13d0feb404 tx_power: various cosmetic fixes in comments
Change-Id: I542b74d79bc8ffedd7c435b41b042edd5152f61c
2017-02-07 20:17:27 +01:00
Harald Welte
4ba7363286 Revert "sysmobts: Add correct nominal transmit power for sysmoBTS 1020"
This reverts commit 1965b0d880, which was
a premature change.  The 10dB gain are not the power of the TRX board,
but are due to an internal, factory mounted PA, i.e. the
trx_power_params.pa.  This will be introduced after adding a set of
tx_power.c unit tests.

Change-Id: I524b63c51fb0fe1f90ced28486a8e712f2dc50ae
2017-02-07 20:17:26 +01:00
Jean-Francois Dionne
eb4a3392e1 Fix SACCH channel release indication not sent to BSC after location update.
Based on GSM 04.08 3.4.13 RR connection release procedure, after the network
sends a deactivate SACCH it receives DISC from MS which cause BTS to
send RLL release indication to BSC in order to stop T3109 timer. It has been
found that after a location update BSC never receives RLL release indication
which causes a T3109 timeout because no TCH is currently allocated. This fix
ensures RLL release indication to be sent to BSC when no TCH is allocated
in the particular case of a location update.

Change-Id: Ibe2a365641eb8c9a7f0a462b7393ec3fd28cc366
2017-02-03 17:18:04 -05:00
Harald Welte
1beb9bcbe0 sysmobts_eeprom.h: Fix/extend model number definitions
Fix the model number definition for the 1020 and add the one for 1002.

Change-Id: Iba4cfbbda1000d7e34eca614b3a6165d2feb65e1
2017-02-02 18:43:29 +01:00
Harald Welte
1965b0d880 sysmobts: Add correct nominal transmit power for sysmoBTS 1020
The sysmoBTS 1020 is a 2W BTS, hence its nominal transmit powre is
33dBm.  We must handle this correctly based on the model-nr in the
EEPROM.   As a result, proper power ramping will be made during start of
the unit by default.

Change-Id: I91a78dadfd7d2e1bc74c8086808c55effdcdd132
2017-02-02 18:41:02 +01:00
Philipp
67bc885c5d octphy: Improve OML ADM state handling
Improve state handling for for lock/unlock of OC_RADIO_CARRIER obj class. in
bts_model_chg_adm_state()

Change-Id: I034114beca95210169429d8ac1eb8648df12fc6c
2017-02-01 19:16:17 +00:00
Jean-Francois Dionne
a760a043c4 Fix AMR HR DTX FSM logic.
Fix SID_FIRST_INH detection during speech and when SID_FIRST is interrupted by FACCH.
Fix SID_UPDATE_INH detection during silence and when SID_UPDATE is interrupted by FACCH.
Add a delay for SID_FIRST to appear at the right time after FACCH.
Fix extra byte sent in downlink for SID_FIRST and SID_UPDATE.

Change-Id: Ia811305e15541f2376005df736bd610e8b0d2f69
2017-02-01 19:13:16 +00:00
Minh-Quang Nguyen
16b4179fbe rsl: Fix dropping of LAPDm UA message.
In some cases, when successive mobile originated calls are made, the LAPDm UA
message gets lost because the channel is relased to early. Too overcome the
problem we do not send relase indications immediately. Instead a flag will be
set and the message stored and sent on the next TCH-RTS-IND.

This commit adds the functionality to store the release indication msg, to
rsl.c. It also addes the mechanism to forward the release indication to l1sap.c
See also coresponding change in openbsc.git:
Change-Id I15fc1ef8e9e83f009bde96de9a8e95702cffbce6

This patch is is a slightly improved/reformatted version of:
95d1f15ad1

Change-Id: Ie4f70c75f0137b4bd72d579b3a32575bac2fca38
2017-02-01 16:35:42 +00:00
Jean-Francois Dionne
42ffb325f8 DTX: fix "unexpected burst" error
Fix error during FACCH interruption of DTX for AMR HR.

Max's note: added fix for sysmobts.

Change-Id: Ib064952331b4f89676ee68a3d8078b1d9debe570
Related: OS#1801
2017-02-01 14:25:14 +00:00
Philipp Maier
9344080109 cosmetic: remove stray newline in octphy's l1_oml.c
Change-Id: I6b60e5ee03b9afe6595bf44c4a963d23d03a4eb7
2017-01-31 11:14:49 +00:00
Jean-Francois Dionne
8c45ae59f9 sysmo,lc15: fix memory leak at each call placed
Max's note: added same fix for default case and ported it to sysmobts.

Change-Id: Ife1293e3238cfda16eac9c28e7e81ffe5595e031
2017-01-31 11:06:52 +00:00
Philipp Maier
d81e5e963a cosmetic: Remove stray newlines in octphy_vty.c
Change-Id: I33f5c4a3f40c0299a7cdb9c62094f0f914edfc98
2017-01-31 11:02:40 +00:00
Philipp Maier
c1d8f5a490 octphy VTY: fix vty write output for octphy's phy section
Fix invalid configuration generated by VTY 'write' command for the 'phy'
section of osmo-bts-octphy.

The problem was introduced during refactoring
commit d784e50747 (Sat Jan 9 13:13:37
2016 +0100, "Introduce new phy_link and phy_instance abstraction")

Change-Id: Ib018e07e332aa8a6144fb2d87889032bd5fc2533
2017-01-31 10:39:25 +00:00
Max
f65b57a707 Add ctrl command to send OML alert
Change-Id: I228cb71ab945e19e3747843469a52f577ee32f97
Related: OS#1615
2017-01-25 13:29:03 +01:00
Max
871e0bec7e OML: internalize failure reporting
* make oml_tx_failure_event_rep() static and use osmo_signal_dispatch()
  wrapped into oml_fail_rep() to trigger event reports outside of oml.c
  instead of directly calling into OML layer
* remove unnecessary formatting from text messages

Related: OS#1615
Change-Id: I738555c547926e97b325ab53763c0076c42309bc
2017-01-25 13:24:52 +01:00
Holger Hans Peter Freyther
10b11325a7 build: Do not require more headers from OpenBSC
There should be no other OpenBSC headers included and nobody is using
bsc_controlif_setup. Remove the include. This was introduced in
4723a19508.

Change-Id: I581f938e8fe9161b1d7076cedd74ff192cea86b2
2017-01-24 14:56:44 +01:00
Holger Hans Peter Freyther
8be9d7a6fe debian: Use the header files installed by openbsc-dev
Use --with-openbsc= to pick up gsm_data_shared.h coming from the
openbsc-dev package. With the revert of the change
Iec6b0f0eb0b7fffaa814c9769c0ee777d641a07f, packaging could work
now.

Change-Id: Ie0a005315454a6450205ce6fd76242b85405de8d
2017-01-24 13:16:29 +00:00
Holger Freyther
ea5ccfa481 Revert "deb: use gsm_data_shared.* from openbsc-dev"
As the Osmocom project is providing packages and we build them
directly from git we should have native packages. openbsc-dev
should provide files in the same directory structure as the git
repository and then --with-openbsc=/usr/src/osmocom/openbsc/openbsc/include/openbsc
can be used. Follow up patches are coming.

This reverts commit 70b71507c2.

Change-Id: I8bc3a5c2b9446d9e94e362ed5d85a61e3a727f8b
2017-01-24 13:16:21 +00:00
Philipp
2b763cc30c octphy: set tx attenuation via VTY
add code to configure the transmision power via VTY

Change-Id: I76bb8660eb1d8baeb6b8f69da4a6ba9ab7319981
2017-01-23 12:23:17 +00:00
Max
70b71507c2 deb: use gsm_data_shared.* from openbsc-dev
Use gsm_data-shared.* from absolute path where it's installed by
openbsc-dev package instead of relative path to fix OBS package
building.

Change-Id: Iec6b0f0eb0b7fffaa814c9769c0ee777d641a07f
Related: OS#1860
2017-01-20 12:20:14 +01:00
Philipp
c37fd88985 l1sap: fix missing 'else's causing wrong rach frame expiry counts
This bug was introduced in the recently merged
commit 1e399f888e
aka change-id I87f40f5f160a4f6750c4f3d06997fc4f24049303

Fixes: coverity-scan CID#160156 and CID#160155
Change-Id: I88ed1b3e59213acdf97f88eda097b8172b952a5e
2017-01-16 23:38:30 +00:00
Philipp
1e399f888e l1sap: Fix expired rach slot counting
The counting of the expired rach slots in l1sap.c is not correctly
implemented. This commit fixes the implementation. The expired
rach slots are now conted correctly according to the configured
channel combination. If a CCCH and SDCCH are combined, only the
frames related to rach slots are counted.

Change-Id: I87f40f5f160a4f6750c4f3d06997fc4f24049303
2017-01-12 23:36:04 +00:00
Jean-Francois Dionne
0e5b12f981 lc15,sysmobts l1_if: fix memleak in handle_mph_time_ind()
Change-Id: I3061060235a488b114b636b3af9a2253a94de1e8
2017-01-12 11:13:35 +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
Jean-Francois Dionne
b76043e6f4 DTX: fix SID-FIRST detection
Max's note: made similar modification to osmo-bts-sysmo/tch.c

Change-Id: I76e62783b73803dfc0d32693a68020a9d89878b8
Related: OS#1801
2017-01-10 23:28:19 +00:00
Max
de6d25e21d Remove obsolete define TLVP_PRES_LEN
The libosmocore version required by configure.ac already has
TLVP_PRES_LEN anyway.

Change-Id: I3e33d9d1a6160ea17ab0a875c65a98129e3d19c1
2017-01-10 17:18:05 +01:00
Philipp
4723a19508 CTRL: make the CTRL-Interface IP address configurable
Currently the IP address where the control interface is bound
to is hardcoded to 127.0.0.1. This leads to problems with
multiple instances on one and the same machine. This commit
integrates the ctrl interface bind option into the VTY, so
that we can bind the ctrl interface to any IP address, just
like we do it with the VTY already.

Change-Id: If51e0c645c0789a4f4a8c51737fb81fb12f80829
2017-01-10 15:45:59 +00:00
Philipp
962b33ea9d OML: fix possible segfault: add NULL check in oml_ipa_set_attr()
oml_ipa_set_attr() is using gsm_objclass2mo() to determine the
*mo object. However, it is possible that gsm_objclass2mo() returns a
null-pointer. The code following up is using *mo without checking.
Reject instead of dereferencing a NULL *mo.

Fixes: coverity scan CID#159533
Change-Id: Ia2cc9bc504c46ca3843c43d712cd8649bfae9526
2017-01-10 14:14:51 +00:00
Philipp
563b744b38 RSL: add assertions to check args of public API
The public functions in rsl.c do not check for null pointers,
add assertions to catch null pointers early.

Change-Id: I63f127ce70a4127180f90238f564b63e355216ec
2017-01-10 14:13:56 +00:00
Philipp
792573dc97 RSL: drop obsolete NULL check
rsl_rx_paging_cmd() checks if the pointer *trx is NULL, this check
does not make much sense since *trx has already been dereferenced
without checking earlier in the code. Furthermore *trx is also a
mandatory parameter which must not be NULL.

Fixes: coverity scan CID#159534
Change-Id: I17dfb42ff404b2a1e18354fb7a7278089b407a79
2017-01-10 11:53:50 +00:00
Max
ec11a85929 Alarm on various errors
Send OML Failure Report for unsupported BTS attributes and other errors.

Change-Id: Ic163bcfb6361a8ebd39e0bc0f238ef51e2cb214e
Related: OS#1615
2017-01-08 11:09:58 +00:00
Max
c038cb7903 Add Abis OML failure event reporting
Send 3GPP TS 12.21 § 8.8.2 Abis/OML failure event report.

Change-Id: Ib1170edca2207752984a554d7a6a57c224f6d5f5
Related: OS#1615
2017-01-08 11:03:39 +00:00
Max
94dd5060c8 Log socket path on error
Change-Id: If912ac0bc815986de2a231facb5cf317a677be68
2017-01-06 17:30:01 +01:00
Max
2cf6b73a42 Move code to libosmocore
With libosmocore commits I9c3bc15662949654e7bba6aad5488c69ee7d0c45 and
Ieaaaed19da9c069fe451faa53d24c5b84d7d5615 functions to copy and merge
parsed TLV were added as well as abis_nm_att_tlvdef_ipa TLV definition
with related enums. Hence we can remove it from here.

Change-Id: Ia4980062ea88ffe9019b201f84e92e006ae3c2e3
2017-01-06 12:24:42 +01:00
Max
f3763590bd Add copyright for .deb packages
Add debian/copyright in Debian format which should have been added in
c2ecca6b04.

Change-Id: I4c7ef1286ba6d2f3c6aadc8ea1864be513f8cf1d
Related: OS#1694
2017-01-06 10:33:06 +00:00
Neels Hofmeyr
bfd42c2b0a fix: dyn ts: uplink measurement report
Fix pchan value used for uplink measurement decisions for dynamic channels in
TCH mode.

Fixes this error log message flooding the osmo-bts log when a dyn ts is serving
a voice call:

  <0004> ../../../src/common/measurement.c:104 (bts=0,trx=0,ts=3,ss=0) no space for uplink measurement

Change-Id: Id19316701fd8de6f295eeae0272eea0c315ab1b7
2017-01-06 10:32:19 +00:00
Max
f9778b2a26 DTX AMR HR: fix inhibition
* Unlike in AMR FR, in AMR HR incoming ONSET have to be treated
  differently depending on whether we've recently sent SID UPDATE or
  EMPTY frame. Split ST_SID_U FSM state into 2 states to accommodate for
  that and make sure that additional states specific to AMR HR are not
  used for AMR FR.

* Avoid sending E_VOICE and E_SID_U in corresponding states
  as those do not initiate FSM state transitions anyway. This decrease
  extra load from FSM signalling which otherwise would be triggered on
  per-frame basis.

* Introduce separate signal for SID First P1 -> P2 transition to avoid
  confusion with E_COMPL and E_SID_U initiated transitions from P1
  state.

* Don't init DTX FSM for SDCCH channels.

Change-Id: I229ba39a38a223fada4881fc9aca35d3639371f8
Related: OS#1801
2017-01-04 11:25:17 +01:00
Max
c2ecca6b04 Integrate Debian packaging changes
debian/control:
    * restructure to make it easier to incorporate further changes
    * update package descriptions
    * update project URL

debian/rules:
    * use proper hardening syntax
    * restructure to make it easier to incorporate further changes
    * remove useless comment
    * add cleanup and test overrides

debian/compat: update compatibility version

Change-Id: Ibf62448eee1df914d21834f5b54831e3f642b79c
Related: OS#1694
2016-12-22 15:11:05 +01:00
Ruben Undheim
86d7843712 Fix some spelling errors
Change-Id: I5b57102f961f8fd7fb0689ceeaa37dd021535b17
2016-12-22 14:04:22 +00:00
Jean-Francois Dionne
304420ca42 DTX: don't always perform AMR HR specific check
Disable check specific to AMR HR if not DTX is enabled.

Change-Id: I8af1daffbd7e59fef6e671dbd9b820497f82d354
Fixes: OS#1892
2016-12-22 12:55:30 +01:00
Max
fbe655f320 Optionally use adaptive RTP jitter buffering
* add vty option to manually enable adaptive RTP jitter
  buffering (disabled by default) on per-bts level
* use this setting on per-lchan level when setting jitter parameters via
  vty at runtime
* check and log result of osmo_rtp_socket_set_param()
* note: older libosmo-abis will ignore this setting which will be
  properly detected via return value
* if jitter buffer is disabled by configuring "rtp jitter-buffer 0" than
  adaptive buffering is disabled as well but it will be used if jitter
  buffer is set to different value for a givel lchan via vty

Change-Id: I489f3c419039f40b57c2ef0641c176478b8d3566
2016-12-16 14:04:50 +01:00
Max
fed8ce3c5a DTX: fix TS adjustment for ONSET
Previously timestamp was always adjusted according to FN difference. In
case of ONSET event this causes unnecessary TS gap with subsequent
speech packet. Fix this by checking Marker bit before performing
adjustment.

Change-Id: I9bf4b45aa990dd4014334dd846f43f793366056c
Related: OS#1801
2016-12-15 19:57:04 +00:00
Max
2c95ae6a09 osmo-bts-trx: fix lchan deactivation
Use chan_nr for deactivating lchan instead of lchan->nr: chan_nr is the
RSL Channel Number IE value, a bitfield aggregation of lchan type
bits (cbits) and lchan number (lowest three bits). The error was
introduced in 36153239bf.

Change-Id: I6dd7060422ab9d18743c1ff2ab419e3e7299d74d
2016-12-12 12:36:28 +01:00
Max
a1fa955212 Save RTP metadata in Control Buffer
Having RTP metadata is useful for debugging - save Sequence Number and
Timestamp next to Marker bit from RTP header.

Change-Id: I359b3bcb74fbfc071547fe2f9d837829374fe997
2016-12-09 11:54:38 +00:00
Max
55a7b07417 DTX: add explicit check if DTX enabled
Check explicitly if DTX is enabled for AMR before checking if SID frame
repetition is optional.

Change-Id: I660688d56505798cade1495c30338fd6806a3259
Related: OS#1801
2016-12-08 14:44:02 +01: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
Neels Hofmeyr
20363d165e bursts test: test_pdtch: pre-init result mem
Fixes: CID#57943
Change-Id: I4547f47c4150759d5c4ab790e34e91b784b03b39
2016-12-02 12:10:03 +00:00
Max
4a85828462 Fix AGCH/PCH proportional allocation
Do not assume that 1 == BS_AG_BLKS_RES but take that information from
SI3. Note: due to current implementation quirks we activate channels
before SI3 obtained, than we deactivate channels upon receiving SI3 and
activate them again. This might not be necessary once we migrate to
proper OML state machines.

This affects lc15 and sysmo hw.

Change-Id: I11377b12680ac3b2f77f80e742b6f0af63fc9c1e
Related: OS#1575
2016-12-01 15:25:26 +00:00
Neels Hofmeyr
b58aa60d78 cosmetic: vty prompts: add space after '#'
Typically, our VTY prompts have space after the '#', but some of the osmo-bts
VTY prompts don't:

  OsmoBTS# configure terminal
  OsmoBTS(config)# bts 0
  OsmoBTS(bts)#gsmtap-sapi ccch

Add spaces after the '#' to yield e.g.

  OsmoBTS(bts)# gsmtap-sapi ccch

Change-Id: If0591a359e77f01abb76c4113181af7a7733ddd4
2016-12-01 15:21:52 +00:00
Max
36153239bf Remove duplicated code
Remove lchan deactivation related code duplication to facilitate future
use for dynamic CCCH re-activation.

Change-Id: Id0d3b19dbfaa16d1734321a07a6eb0355bfd77c9
2016-12-01 15:20:42 +00:00
Max
aabeb2eae4 DTX DL AMR: rewrite FSM recursion
Add explicit state for recursion (sending the different payload data in
response to the RTS request for same FN) and corresponding
transition. Remove ST_FACCH_V as with new explicit recursion handling it
becomes unreacheable. This makes it easier to maintain
preemption (interruption of current procedure due to FACCH or
Inhibition). This also reduces the number of possible transitions out of
each state thus reducing graph's cyclomatic complexity.

Change-Id: If39b68083d23a4a35f468a5d75f54eb733ebfd14
2016-12-01 14:49:43 +00:00
Alexander Chemeris
f4b238f91e trx: Add "maxdlynb" VTY command to control max TA for Normal Bursts.
Originally `maxdly` command in osmo-trx was contrlling max TA for Normal Bursts.
This was not a proper behaviour, because it was used to "control maximum
distance a handset can attach from" which is controlled by Access Bursts max TA.
Osmo-trx was corrected to apply `maxdly` to Access Bursts and a new command was
introduced to contrl max TA for Normal Bursts - `maxdlynb`. This patch adds
support for this configuration command into osmo-bts-trx.

If you wonder why would you need that - some test equipment (namely R&S CMD57)
has really bad timing sync and can generate signal a few symbols off. That
prevents osmo-trx from properly receiving otherwise perfectly good bursts
generated by CMD57. This configuration is a solution for this.

Change-Id: Ib5d255299668ac1ef9f0ce95e016f55ba3c82277
2016-12-01 14:49:15 +00:00
Neels Hofmeyr
103ddc7155 jenkins: add jenkins_bts_model.sh
Change-Id: Ie7c32e68f789414fdf3c407c0da06cbf983f751a
2016-11-30 04:25:42 +01:00
Neels Hofmeyr
704fba5dc2 add jenkins_oct_and_bts_trx.sh
Change-Id: Ib656d4592f5210e2c180f511a1c955d14397bd03
2016-11-30 03:01:30 +01:00
Neels Hofmeyr
dd8a4a85e4 add jenkins_bts_trx.sh
Change-Id: Ie27ffb72140cb37e6a05bffd90551197f1e9b5fc
2016-11-30 02:46:43 +01:00
Neels Hofmeyr
6f4ce14ed7 osmo-bts-trx: remove obsolete include of netif/rtp.h
Change-Id: Idf364fd7d69446a7a996062f71d701d9c6cca84c
2016-11-29 22:41:59 +01:00
Philipp
8ea93a8a7d octphy: multi-trx support: fix AC_CHECK order
The header file octphy/octvc1/gsm/octvc1_gsm_default.h is not
visible to the configure script when the octphy header files
are referenced via --with-octsdr-2g instead having them
installed in /usr/local/include. This results in a failed
AC_CHECK_MEMBER check for tOCTVC1_GSM_TRX_CONFIG.usCentreArfcn,
even if header files with multi-trx support are used.

The configure.ac script manipulates the CPPFLAGS in order to
make the octphy include files visible to AC_CHECK_ and restores
the original CPPFLAGS when done. This is required when
--with-octsdr-2g is used. AC_CHECK_MEMBER is executed
before the CPPFLAGS are manipulated. This causes no issues
if the headers are properly installed to /usr/local/include,
but does not work when --with-octsdr-2g is used.

This commit moves the AC_CHECK_MEMBER command into the section
where the manipulated CPPFLAGS are valid in order to fix the
problem described above

See also commit: f5494e84e8

Change-Id: I7bdfa4449cd6061c395cce315b372c2833520e37
2016-11-27 18:28:24 +00:00
Harald Welte
ae5405e2a4 vty: Ensure to not use negative (error) sapi value
Change-Id: I282311de8514c1cc0a1b716e97e90ddf48863bb4
Fixes: Coverity CID 57617
Fixes: Coverity CID 57618
2016-11-25 23:50:46 +01:00
Neels Hofmeyr
be671bc61f cosmetic: tweak README
I noticed that the README is prominently shown on github, so it makes sense
to get rid of the worst typos and misinformation there.

Change-Id: I60defef6224a78bb84d7d0b57bc8da17ad7877bb
2016-11-23 00:05:13 +01:00
Alexander Chemeris
f7b559f960 vty: Add commands to manually activate/deactivate a channel.
This is the easiest way I found to make BTS level loopback to work.
Another way to implement this is to have BSC/NITB to send the OML command, but
it's a longer path with no clear benefits.

Note, that the current code hardcodes the channel to be TCH/F with v1 speech,
which is what we need for the basic BER testing. We may want to extend this
later to support more channel types.

Change-Id: Ia2734afeff023e5b3d6b934c7e8b1ed95a071b72
2016-11-16 16:38:51 +00:00
Alexander Chemeris
b2fbdd023b l1sap: Fix use-after-free in loopback mode.
By default l1sap_tch_ind() returns 0 which signals to its caller that message
has been processed and can be freed. In case of loopback we're forwarding
the message to dl_tch_queue who will free it later.  Returning 1 from
l1sap_tch_ind() prevents caller from freeing message.

Change-Id: I1e065075baa51c88fa717f132e1f0a83df68be02
2016-11-14 17:40:34 -08: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
bdf10eb705 Remove duplicated code
Having duplicated code to fill in fn & tn values makes it harder to read
and modify static gsmtap_p* functions. Fix this by removing the
duplication and moving the common code one level up.

Change-Id: I0e67bf7423424cc11435bc0a5a1110297eeee383
2016-11-11 12:22:11 +01:00
Neels Hofmeyr
c43352dbc4 fix 'osmo-bts-* --version' segfault
Call vty_init() before handle_options() to make sure the host.app_info is
populated before --version potentially tries to print it.

Change-Id: Ic87b5498b57b2f0f876171a15e769b74c28348c1
2016-11-09 15:44:30 +01:00
Max
c757272443 dtx_check.gawk: add check for repetitive SID FIRST
Change-Id: Id7acdfae7880fb488b65435ab8d33f2874499967
2016-11-08 16:27:47 +01:00
Max
388a91cbd1 Add libosmocodec for octphy build
Similar to 4582222757 fix build by linking
with libosmocodec explicitly.

Change-Id: Ib52135936ae02d804b60f61088b4bdd227a71aa0
2016-11-08 15:27:29 +01:00
Max
5ee3dba39f DTX: wrap FSM signal dispatching
Make wrapper function which checks that DTX is enabled for lchan before
dispatching any events.

Change-Id: Id8b519c4af6d505ec9a4b9aadd5107bf7af53d66
2016-11-08 12:28:52 +01:00
Max
9f936344ea DTX DL: tighten check for enabled operation
Introduce dtx_dl_amr_enabled() function which checks that DTX is enabled
and FSM is allocated and use it for all corresponding checks.

Change-Id: Ifa68b641265ed14f242765c85e40da2d1021a541
2016-11-08 12:22:40 +01:00
Max
57b5fb8819 Fix tests linking with libosmocodec
Change-Id: I051302f867d70dfbc39bd52d75101eb262f87459
2016-11-08 10:26:40 +00:00
Max
203ea2c209 dtx_check.gawk: Fix false-positives in DTX check
Previously, if ONSET happened exactly at the place where next SID FIRST
or UPDATE should be it was incorrectly detected as error. Similarly,
continuos FACCH was misinterpreted as error.

Change-Id: I43fdbceea0dbdb0833c3b1cf0fc3b825803ed30e
2016-11-08 06:54:36 +00:00
bhargava
38843fbf48 Initialize parameters in osmo-trx for 11bit RACH
The parameters related to support 11bit RACH are initialized in
osmo-trx. These parameter determaine the type of the RACH received
in osmo-pcu.

Change-Id: I164d449303373d0757719d5204f4716975fb517a
2016-11-08 11:56:08 +05:30
Max
acfccb3f02 DTX fix ONSET handling
* re-introduce ST_ONSET_F to guard from repetitive ONSET messages in case
  multiple FACCH occur duriing DTX silence period.
* produce ONSET event after both SID FIRST and UPDATE in case of AMR FR.
* always dispatch E_SID_F (SID FIRST) signal if in talkspurt.
* allow E_SID_* right after ONSET (zero-length talkspurt).
* add missing E_ONSET signal description.
* fix FSM transitions for AMR HR *Inhibited and First P*.
* fix incorrect return from l1if_tch_encode() in ONSET FACCH with
  incoming SID UPDATE

Change-Id: I0e9033c5f169da46aed9a0d1295faff489778dcf
Related: OS#1801
2016-11-03 12:31:37 +00:00
Max
4008ebb925 DTX DL: add AMR HR support to scheduling check
superfemto.sh: Expand log converter to use case-insensitive matching to
accommodate for spelling differences in DSP logs. Add strings/events
specific to AMR HR.

dtx_check.gawk: Remove redundand variables from output. Add checks
specific to AMR HR.

Change-Id: Icce3178605f46bbf3cad15d4eaff18a4d164ad1a
2016-11-03 12:31:37 +00:00
Max
9d102508a8 Remove obsolete define
It was moved to OpenBSC in 582e4f627674f46310a90d9061e82fb342051b42 as
it's used by both projects.

Change-Id: I8aba987e3cdaa840cf3e14913a8455b0ba759889
2016-11-02 09:29:39 +00:00
Max
bce25a60f4 DTX DL: split ONSET state handling
Handle ONSET cause by Voice and FACCH separately. In case of Voice we
have RTP payload which we have to cache and send later on in next
response to L1 RTS. FACCH have higher priority so it preempts both voice
and silence alike - hence we can send ONSET immediately but still have
to track previous state in order to get back to it gracefully.

This affects lc15 and sysmo hw as there's no FSM-based DTX
implementation for other models yet.

Note: this requires patch for OpenBSC which adds FACCH buffer to tch.dtx
struct.

Change-Id: Idba14dcd0cb12cd7aee86391fcc152c49fcd7052
Related: OS#1802
2016-10-28 13:42:29 +00:00
bhargava
efb4a4baeb 11bit RACH support for osmo-bts-litecell15
Based on the indication from L1, number of bits in RACH and burst
type is determined. Appropriate parameters are filled in
osmo-bts-litecell15. These parameters are sent to osmo-pcu for
processing of the RACH.

Change-Id: Ie5207a15424fb287febf74e830297531232accde
2016-10-27 19:54:53 +05:30
Max
64a2bd72f5 Add tools to check DTX operation
* superfemto.sh can parse superfemto-compatible DSP log output to
  properly sort records into MT/MO and DL/UL parts
* dtx_check.gawk can process output of superfemto.sh and check for
  common scheduling errors

This allows to check lc15 and sysmo for errors in DTX DL scheduling. As
dtx_check.gawk is generic it can be used with any other BTS hw (or
virtual BTS) as long as raw logs from this hw can be converted to simple
input format 'FN EVENT' per-line.

Change-Id: Ib1c70c4543b24c2a05a7df8eec5ce3f4eda2c02e
Related: OS#1801
2016-10-26 17:33:55 +02:00
Max
ced9a5d0e2 Fix DTX DL AMR SIDscheduling logic
Previously SID UPDATE was sometimes scheduled incorrectly. Fix this by:
* avoid rounding error when computing scheduling time difference from FN
* properly saving and updating cached SID type and FN

Change-Id: I7acffae4792e7bddc2ae19a2f04ee921dc194c36
Related: OS#1801
2016-10-24 08:55:19 +00:00
Max
5a4f4d12e1 DTX HR - fix array size calculation
Use ARRAY_SIZE macro for each pointer separately.
Fix suggested by Neels Hofmeyr <nhofmeyr@sysmocom.de>.

Change-Id: I68ec1be33fb743977121d654187d85d6b8451e2b
Fixes: Coverity CID 150132
2016-10-24 08:43:30 +00:00
Max
c22da59342 Extend RTP RX callback parameters
Adopt to change in libosmo-abis to accept additional parameters in RTP
RX callback function.

Change-Id: Icf41e568f041e87b38e6192af0be90c42362bfee
2016-10-21 19:53:34 +02:00
Neels Hofmeyr
068918f990 jenkins-oct.sh: fix build: typo in deps path
Change-Id: I05014e25ffc829fa2fc3973471baa28f7f5a62c9
2016-10-18 21:03:20 +02:00
Max
c88a10cece Fix lc15 build
The error seems to be introduced in 21142f7898

Change-Id: I620ac6774fb47479d74bc4470ccc6edd379600ba
2016-10-18 16:40:45 +02:00
Max
ebb483b69a Replace magic number with define
SDCCH occupy lchan 0..3 in combined configuration so for CCCH we've
always used lchan[4] - replace it with CCCH_LCHAN define and add
comment.

Change-Id: Ic5d742c292d638f119c6b4672120c1950adeb7f0
2016-10-18 08:08:25 +00:00
Max
b0c1d21581 DTX AMR - fix buffer length check
Consider AMR-specific prefix in computing max length to avoid triggering
coverity check.

Change-Id: I2fbc468caedf08f26893457db7c7fbacef5b860c
Fixes: Coverity CID 150133
2016-10-17 08:11:01 +00:00
Neels Hofmeyr
21142f7898 msgb ctx: use new msgb_talloc_ctx_init() in various main()s
Change-Id: I31d62d5e1f0b272985fdef5013270d385c4b988a
2016-10-14 01:23:28 +02:00
Max
b058778df1 DTX: fix array size calculation
Compute array size in-place and pass it to function.

Change-Id: I4cd480ceb20efc69df1b00e3c7359fcbd14c19cd
Fixes: coverity CID 1357844.
2016-10-13 11:02:59 +00:00
Max
de9dbe7958 TRX: fix building with latest DTX changes
Bring up-to-speed with latest changes in OpenBSC.

Change-Id: I16b24b2cd09600e215de163e7b5baae329887c9e
2016-10-13 11:45:56 +02:00
Max
babd05661d DTX DL: use FSM for AMR
Use dedicated FSM to handle all DTX DL related events:
- add explicit checks if DTX DL is enabled (fixes regression for non-DTX
setup introduced in 654175f33b)
- fix handling of AMR CMI for SPEECH frames
- add FSM for DTX DL
- sync with corresponding changes in OpenBSC's
- handle FACCH-related DTX ONSET events

This affects both lc15 and sysmobts and requires corresponding change in
OpenBSC (Change-Id: Idac8609faf9b5ced818fde899ccfc6ed0c42e8fd).

Change-Id: I74a0b42cb34d525b8a70d264135e82994ca70d31
2016-10-13 06:58:06 +00:00
Neels Hofmeyr
c09e5a44c3 jenkins.sh: use osmo-build-dep.sh, log test failures
Like in libosmo-abis' and other jenkins.sh

Change-Id: I6ad88bce18677b148af63ae8f6e0ab7e3b38b5a2
2016-10-12 11:29:05 +00:00
Philipp
93f3102da9 rsl: improving the log output
to show more details about the payload type and the connection

Change-Id: Ifaa253e5baed5ca364dfbc046a7cb559f106bfbd
2016-10-12 10:17:43 +00:00
Philipp
b8b939faa9 octphy: prevent mismatch between dsp-firmware and octphy headers
in its current statue l1_oml.c does not check if the version
number in the header files (octvc1_main_version.h) matches up
the version that is reported from the DSP during startip. This
patch ads a check to make sure that the currently loaded
firmware and the headers used during compile time match. If
a mismatch is detected, osmo-bts exits immediately.

Change-Id: Icba5756517d632d53b129c5ce1a1dab4936dab91
2016-10-12 09:57:18 +00:00
Max
4ca5be766c Move copy-pasted array into shared header
Change-Id: I377ece2845830e3defab2d515f44b629ce5aed8e
2016-10-12 09:30:06 +00:00
Max
9f9b96a67b DTX: fix conversion from fn to ms
Previously FN was converted to millisecondss incorrectly due to wrong
conversion between FN and a number of voice samples. The conversion
should be based on following:
* there are 12/13 useful frames for audio in TCH
* there is 1 RTP packet per 4 frame
* there are 160 samples per RTP packet

Fixes: OS#1801
Change-Id: I9cc70cacabde98621aa892cee74f4ac461645093
2016-10-11 18:20:15 +02:00
Yves Godin
c1b86d80d1 DTX: fix 1st RTP packet drop
Use "impossible" dummy value to initialize last_fn to prevent dropping
of 1st RTP frame due to timestamp jump.

Fixes: OS#1803
Change-Id: I485af21f6761048d12dc7f5552fcdd46daf786ed
2016-10-11 15:50:29 +00:00
Philipp
8b39ff8bcf octopy: fixing renamed constant
The constant cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_UNUSED in header
file octvc1/hw/octvc1_hw_api.h has been renamed to
cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_IDLE. This commit adds an ifdef
decision in to code to ensure that older header files will still work.

Change-Id: I4c0b976d29689ace06741c5943434fc33ee2df14
2016-10-06 10:12:04 +00:00
Philipp
f5494e84e8 octphy: reintroducing multi-trx support
The multi-trx had to be removed because of build conflicts
with octphy header that lack the struct members for needed
to support multi-trx.

For details see the following revert-commits:
ed6b48e4a5
c9a1f284ac

This commit reintroduces multi trx support and ads an ifdef
decision to ensure that header files without multi-trx
support still work.

Change-Id: I7f9b2906cc149c817183745b4c96bcc7f9ebdad0
2016-10-06 09:48:02 +00:00
Neels Hofmeyr
3f192f2291 configure: check for pkg-config presence
Change-Id: Ifee0434dfa275f9faa517c740fd8577930f37188
2016-10-02 13:29:21 +00:00
Neels Hofmeyr
fac02d3d75 build: be robust against install-sh files above the root dir
Explicitly set AC_CONFIG_AUX_DIR.

To reproduce the error avoided by this patch:

  rm install-sh        # in case it was already generated.
  touch ../install-sh  # yes, outside this source tree
  autoreconf -fi

This will produce an error like

  ...
  configure.ac:16: error: required file '../ltmain.sh' not found
  configure.ac:5: installing '../missing'
  src/Makefile.am: installing '../depcomp'
  autoreconf: automake failed with exit status: 1

See also automake (vim `which automake`) and look for 'sub locate_aux_dir'.

Change-Id: I02153ad52faf1465e9f7821378e04118f17352d2
2016-10-02 13:29:21 +00:00
Max
5f2e2de84f DTX: send AMR voice alongside with ONSET
When ONSET event happens (either via Marker bit or due to unmarked
talkspurt) we should first send Onset event to L1 and than send voice
data in response to the same PH-RTS.ind.

Change-Id: I2a7b89430ca49eee4a350c5f980bd6bcbc386347
2016-09-30 19:13:08 +02:00
Max
067ef3f1ce DTX: move ONSET detection into separate function
Move code from tch.c (lc15, sysmo) into generic function which:
- check if talkspurt is happening
- cache SID if necessary or invalidate cache
- fill in CMR & CMI prefix

This also fixes the problem when SID FIRST was cached without sending
just like SID UPDATE instead of being sent right away.

Change-Id: I6c7016a54749abadeef4fd4f5b6f750b256fb916
2016-09-30 19:09:04 +02:00
Max
9959f45d90 DTX: further AMR SID cache fixes (lc15, sysmo)
* consolidate AMR CMR and CMI handling in common/amr.c
* use it in save_last_sid()
* remove dead code
* properly compute RTP payload length for AMR
* use save_last_sid() for FR & HR as well
* invalidate cached SID if SPEECH frame is received

Fixes: OS #1800, #1801
Change-Id: I5a1c1ad0b0a295a50e67775a4db85f1d331755ed
2016-09-30 18:57:00 +02:00
Max
7dffd553df DTX: move scheduling check inside repeat_last_sid
Note: this also require changes to properly link against libosmocodec -
see 2bb65be159dfdabf664fec569b343320301701b0 in libosmocore.

Change-Id: I96594cf3aa1013d505bd20069d5bf261d9a2aefb
2016-09-30 16:50:47 +02:00
Max
94fa25295f LC15: Clarify msgb ownership / fix memory leaks
This is similar to 21b020b336 which
changes the way msgb is allocated/freed in sysmobts.

Change-Id: I393828a7b1fb5927453ee25f54d605a5d3ea7087
2016-09-30 11:36:29 +02:00
Max
1559678fa2 DTX: remove misleading comment
There's no SID stored in UL direction so there's nothing to remove.

Change-Id: I3f587a66406bc6a02b859e826f4903641fcc5a15
2016-09-26 16:31:25 +02:00
Max
654175f33b DTX: check Marker bit to send ONSET to L1
If Marker bit is set than it's a talkspurt which we have to explicitly
indicate to L1 by first sending ONSET message and than actual voice
data in a separate message.

This change affect sysmobts and LC15 hw.

Change-Id: I88c41568bcb0d82699f617adc4ad192603dd1bb6
Related: OS#1750
2016-09-24 15:09:31 +02:00
Neels Hofmeyr
eb08a87be5 sysmobts_mgr, lc15bts_mgr: fix tall context for telnet vty
Instead of passing the msgb ctx to telnet_init(), pass the *mgr* ctx.

Change-Id: I213fe52648a1937d8f8c1730ce787e42f0add75f
2016-09-24 03:36:22 +00:00
Philipp
a570e05ec8 octphy: Fixing band selection for ARFCN 0
There is now an exception for ARFCN 0 in osmocom_to_octphy_band to
distingush ARFCN 0 (E-GSM) and 1-124 (P-GSM).

Change-Id: If012f31121e9d0d45b36459807c5f290aa17374f
2016-09-24 03:25:01 +00:00
Philipp
e2069d968c octphy: Fixing missing payload type in ph. chan. activation
in l1_oml.c:ts_connect() the payload type (ulPayloadType) was not
configured to full-rate for PDTCHF PACCHF and PTCCHF. Older octasic
firmwares (below octsdr-2g-02.06.00-B964-alpha) will tolerate this,
newer versions will crash during channel initalitation.

Change-Id: Id2f6a439ceb063b10efc7b9d1d70bb5b29a01033
2016-09-24 03:21:27 +00:00
Max
c77b574d1f lc15, sysmo: Use SID_FIRST_P1 to initiate DTX
Some phone seems to not send SID_FIRST_P2 message which seems like a
different understanding of the DTX spec. L1 accommodates for that by
using P1 to supply data for SID. Hence we should use it to initiate DTX
and ignore P2 message in case of AMR HR.

Change-Id: Iaf993b89caa0ad49b97d1c745dcaf039f867f018
2016-09-23 17:13:14 +02:00
Max
70460814ce DTX: fix SID logic
Previously receiving SID via RTP always caused it's transmission to L1
regardless of the time which might have resulted in excess traffic. Fix
this by only saving SID data and transmitting it later on as necessary
according to 3GPP TS 26.093 A.5.1.1.

Change-Id: Ifcdc5c60d0238b704a94f6778d4e00f2b087b090
Fixes: OS#1801
2016-09-23 17:03:00 +02:00
Max
527dd402c7 DTX: fix SID repeat scheduling
Previously SID retransmission was scheduled incorrectly based on GSM
frames instead of voice frames. Fix this by using GSM Fn only as elapsed
time estimation:

* move saved SID retransmission into generic function from lc15 and sysmo
specific code
* split retransmission time check into separate generic function
* compute estimation for elapsed time since last retransmission using
  GSM Fn

Change-Id: Ib054b458a7345d9ba40dba53754ca59ab099c8e8
Fixes: OS#1799
2016-09-23 16:57:05 +02:00
Max
80473a113d DTX: fix last SID saving
Previously SID was saved explicitly by each BTS model (lc15, sysmo)
instead of relying on generic function. Fix it by using generic function
and propagating necessary parameters for it.

Change-Id: Ie545212cce5ed2b3ea3228597f18a473f5e1deb4
Fixes: OS#1800
2016-09-23 14:53:46 +00:00
Neels Hofmeyr
0a05181603 heed VTY 'line vty'/'bind' command
Like most other osmo-* programs, bind the telnet VTY to the address specified
by the 'line vty'/'bind' command. This is added by vty_init(), so until now the
BTS offered this config but ignored it.

Change-Id: Ic4ab32aee08d8a779adeb9943892de0c828c7b3d
2016-09-22 07:04:54 +02:00
Neels Hofmeyr
b4969cc915 log causing rx event for lchan_lookup errors
Add log_name to lchan_lookup() and pass such from the various RSL rx events
that call it to validate the RSL chan_nr.

Change-Id: I0d9923f47ac655b204169eec302d607412d5754d
2016-09-19 02:12:23 +00:00
Neels Hofmeyr
a91b2d9691 log: sysmo,lc15: tweak log about sapi_cmds queue
The osmo-bts log used to say this a lot:

DL1C <0006> oml.c:758 (bts=0,trx=0,ts=0,ss=1) End of queue encountered. Now empty? 1

- Move this to DEBUG level instead of NOTICE.

- Tweak wording and logic so it says one of:
  [...] End of SAPI cmd queue encountered. Queue is now empty.
  [...] End of SAPI cmd queue encountered. More pending.

Change-Id: I5a46c90d016cee9b50f32db2af568765d3cb74cc
2016-09-17 09:58:27 +00:00
bhargava
ac84afa409 Update parameters in osmo-bts-sysmo for 11bit RACH
Based on the indication from L1, number of bits in RACH and burst
type is determined. Appropriate parameters are filled in osmo-bts-sysmo
These parameters are sent to osmo-pcu for processing of the RACH.

Change-Id: I93831ddfb3f31b637e6a576f23a9bb4557758582
2016-09-14 01:17:33 +00:00
Neels Hofmeyr
d44f0772f9 dyn TS: if PCU is not connected, allow operation as TCH
Before this patch, Osmocom style TCH/F_TCH/H_PDCH dyn TS were paralyzed if no
PCU was running. The state of the dyn TS would lock up in the PDCH activation
phase since the PCU never completed the process.

Make more robust, i.e. don't concern the BSC with PDCH activation failures.
This matches the way plain PDCH TS work: besides declaring the TS as PDCH, the
BSC is not involved and is not told about errors.

During PDCH deactivation, still wait for the PCU to tear down the PDTCH SAPIs,
but in case no PCU is connected, send a rel ack right away.

Thus, the BSC will happily switch Osmocom style dynamic timeslots to and from
PDCH mode, using the dyn TS as voice channels as needed, and not caring about
possible PDCH failures. GPRS starts working right away as soon as a PCU
connects, regardless of dyn TS having been used for voice any number of times,
and without another switchover needed.

In detail:

In rsl_rx_chan_activ(), upon receiving a PDCH activation, send an RSL chan act
ack right away, unconditionally (with an explaining comment). Do not concern
the Abis link with PDCH activation failures.

Since we're acking right away now, drop the chan act ack that would follow
after the PCU activation: as before dyn TS, only send acks and nacks for
rel_act_kind == LCHAN_REL_ACT_RSL (PDCH runs as LCHAN_REL_ACT_PCU).

In dyn_ts_pdch_release, indicate that the PCU is not connected by means of
returning 1. In rsl_rx_rf_chan_rel(), use this indicator to send a rel ack
right away if the PCU is not connected.

Change-Id: I2a0b9730197786b99ff3bc1f08c75f7d279cb1f7
2016-09-09 06:45:27 +00:00
Neels Hofmeyr
3cc91746a3 octphy: fix build with OCTSDR-OPENBSC-02.07.00-B708: name changed
There was an apparent change of name from
 cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_IDLE
to
 cOCTVC1_HW_CLOCK_SYNC_MGR_STATE_ENUM_UNUSED
in:

git://git.osmocom.org/octphy-2g-headers
commit 953a258aadf18c05e8128a339f15b1c5bb377cfd
"Import headers from OCTSDR-OPENBSC-02.07.00-B708.tgz"

In order to build octphy with these headers, apply the same rename in
osmo-bts-octphy/*.

Change-Id: Ic07055860035a7c1b83ab923817423eeb39f33d3
2016-09-06 15:41:10 +02:00
Neels Hofmeyr
c9a1f284ac octphy: fix build: Revert "octphy: add support for multiple trx ids"
This reverts commit c4fc00d851, except: we keep
the part that sets the trx_id in bts_model_phy_instance_set_defaults().

Theoretically, this patch makes a lot of sense, but in order to be able to
build osmo-bts-octphy until the headers version is clarified, revert use of
usCentreArfcn:

Above commit uses an usCentreArfcn member that is never defined in the history
of our octphy-2g-headers.git. This usCentreArfcn does exist in a code snapshot
OCTSDR-2G-02.05.00-B780-DEBUG, which is not (yet?) publicly available.

Also, the current headers version is apparently 02.07, though the octasic
version numbers have been known to cause confusion among osmocom folks.

This along with one other revert fixes this build problem:

make[3]: Entering directory '/n/s/octphy/git/osmo-bts/src/osmo-bts-octphy'
  CC       l1_oml.o
l1_oml.c: In function ‘l1if_trx_open’:
l1_oml.c:1350:13: error: ‘tOCTVC1_GSM_TRX_CONFIG’ has no member named ‘usCentreArfcn’
   oc->Config.usCentreArfcn = plink->u.octphy.center_arfcn;
             ^
l1_oml.c:1352:13: error: ‘tOCTVC1_GSM_TRX_CONFIG’ has no member named ‘usCentreArfcn’
   oc->Config.usCentreArfcn = trx->arfcn;
             ^
In file included from ../../include/osmo-bts/logging.h:5:0,
                 from l1_oml.c:33:
l1_oml.c:1365:13: error: ‘tOCTVC1_GSM_TRX_CONFIG’ has no member named ‘usCentreArfcn’
   oc->Config.usCentreArfcn, oc->Config.usTsc, oc->RfConfig.ulRxGainDb,
             ^

Change-Id: Ic643709e8fb3df2d66337190ed1f07fd230d7dca
2016-09-06 15:40:09 +02:00
Neels Hofmeyr
ed6b48e4a5 octphy: fix build: Revert "octphy: fix for multiple trx with more than 1 dsp"
This reverts commit 06968beab9.

Theoretically, this patch makes a lot of sense, but in order to be able to
build osmo-bts-octphy until the headers version is clarified, revert use of
usCentreArfcn:

Above commit uses an usCentreArfcn member that is never defined in the history
of our octphy-2g-headers.git. This usCentreArfcn does exist in a code snapshot
OCTSDR-2G-02.05.00-B780-DEBUG, which is not (yet?) publicly available.

Also, the current headers version is apparently 02.07, though the octasic
version numbers have been known to cause confusion among osmocom folks.

This along with one other revert fixes this build problem:

make[3]: Entering directory '/n/s/octphy/git/osmo-bts/src/osmo-bts-octphy'
  CC       l1_oml.o
l1_oml.c: In function ‘l1if_trx_open’:
l1_oml.c:1350:13: error: ‘tOCTVC1_GSM_TRX_CONFIG’ has no member named ‘usCentreArfcn’
   oc->Config.usCentreArfcn = plink->u.octphy.center_arfcn;
             ^
l1_oml.c:1352:13: error: ‘tOCTVC1_GSM_TRX_CONFIG’ has no member named ‘usCentreArfcn’
   oc->Config.usCentreArfcn = trx->arfcn;
             ^
In file included from ../../include/osmo-bts/logging.h:5:0,
                 from l1_oml.c:33:
l1_oml.c:1365:13: error: ‘tOCTVC1_GSM_TRX_CONFIG’ has no member named ‘usCentreArfcn’
   oc->Config.usCentreArfcn, oc->Config.usTsc, oc->RfConfig.ulRxGainDb,
             ^

Change-Id: I222766f6961f5f35aa3651e2907e3e908fe9a66e
2016-09-06 15:28:44 +02:00
Holger Hans Peter Freyther
8431bbb80f oct: Attempt to enable the Octphy for the osmo-bts-oct build
Change-Id: Ib41dfe35af1ed2ef270a436a8086a3120fe4d7d6
2016-09-06 13:57:54 +02:00
Neels Hofmeyr
bf6bae2b23 common/rsl: move decision whether to chan act ack/nack to common function
Prepare for a dyn TS patch that needs to call rsl_tx_chan_act_ack() directly
without the rel_act_kind decision.

Add function rsl_tx_chan_act_acknack() to wrap rsl_tx_chan_act_ack() and
rsl_tx_chan_act_nack(). Move the decision whether to drop the ack/nack, based
on lchan->rel_act_kind, to the new function, losing some code dup.

Change all callers to use the new function; drop the two older ones from rsl.h
and make them static.

Note: for nack, the exception for dyn TS in PDCH mode was missing
(rsl_tx_chan_act_nack() had only the rel_act_kind != LCHAN_REL_ACT_RSL
condition, but should also have had the dyn TS exception as in
rsl_tx_chan_act_ack()). I already know that this exception will again be
removed in an upcoming commit, but for patch readability it logically makes
sense to add it here. To easily include the nack case, drop the check for which
pchan the dyn TS is operating as, because a rel_act_kind == LCHAN_REL_ACT_PCU
implies that it is either already in or trying to become PDCH mode.

Change-Id: I57ba60c670730c6d7877a6a9b96ece0a7679a0bb
2016-09-02 04:12:16 +02:00
Neels Hofmeyr
8a148613b4 Fix ip.access style dyn PDCH, broken in 37af36e85e
Commit "sysmo,lc15: ts_connect_as(): log error also for pchan_as == TCH/F_PDCH"
introduced a check for TCH/F_PDCH intended only for TCH/F_TCH/H_PDCH. It looked
correct, but TCH/F_PDCH startup was designed differently:

For TCH/F_PDCH, the idea was to look it up in pchan_to_logChComb[] and obtain
the TCH/F channel combination, so that TCH/F_PDCH first initialize as TCH/F.
So pchan was in fact intended to be passed as TCH/F_PDCH.

For Osmocom TCH/F_TCH/H_PDCH, we've in the meantime added a ts_opstart()
function that makes this decision explicitly. So, instead of reverting the
erratic commit, add TCH/F_PDCH to ts_opstart(), for both sysmo and lc15.

In ts_opstart(), move to a switch statement to resolve the actual pchan to use
for ts_connect_as().

Drop TCH/F_PDCH and TCH/F_TCH/H_PDCH from pchan_to_logChComb[] and comment.

Change-Id: I376b92a06f4cbe943c1c913dea7487fac53a7d08
2016-08-30 12:38:04 +00:00
Neels Hofmeyr
4dfc3da96b dyn TS: sysmo,lc15: ph_data_req: fix PDCH mode detection
Though this patch theoretically makes a lot of sense, it is not entirely clear
why dyn TS are working without it. Committing due to common sense, not to fix
any actual breakage.

Change-Id: I6136cb42a4d627ebefc963eb5321fadfe63cca4b
2016-08-30 07:35:48 +00:00
Neels Hofmeyr
9faaf4ecf0 cosmetic: common ts_is_pdch()
Have one common ts_is_pdch(), placed in lchan.c, since this file is pretty
empty and pretty close to ts. Publish in gsm_data.h.

Remove the if-style implementation from l1sap.c, and instead implement in a
switch statement.

This prepares for upcoming ts_is_pdch() usage in ph_data_req() for sysmo and
lc15.

Change-Id: Ib78d663fdbac5a1d7053f1b9d543649b66da00e2
2016-08-30 07:35:47 +00:00
Neels Hofmeyr
3b2e5de3ae dyn TS: measurement: use correct nr of subslots, rm code dup
In measurement.c, fix the number of sublots for TCH/F_TCH/H_PDCH, by using
ts_subslots() from gsm_data_shared.c. The local dup of subslots_per_pchan[] is
no longer needed. (depends on recent commit to openbsc.git for ts_sublots())

Change-Id: I9d9df470c49487bffd56dde42c7bec0da2f50642
2016-08-30 07:35:47 +00:00
Neels Hofmeyr
988f634c97 log: l1sap: add 0x to hex output of chan_nr, 5 times
Change-Id: I187a74fd255dbdfb9bfb1e32786031a66f013efb
2016-08-27 12:31:32 +00:00
bhargava
e77bcaecb6 Change interface in osmo-bts for 11 bit RACH
Interface structure between osmo-bts and osmo-pcu is updated with the
parameters to differentiate the type of RACH and further support 11 bit
RACH. The function prototype and definitions are changed accordingly.
Interface version number is increased.

Change-Id: I4f4c501b2d86d77c78de32a84b1804172ffb6f4d
2016-08-27 01:20:46 +00:00
Max
43d082e6f1 sysmo: ts_connect: log channel combination name instead of number
Change-Id: Ife11cfdb0f83d56ed61e66286a79b7c3a000cce5
2016-08-21 14:02:30 +00:00
Neels Hofmeyr
55c46022e1 sysmo: fix dyn TS: Revert "Activate PTCCH UL" [in sysmobts]
This reverts commit 53d792c3b0.
See http://osmocom.org/issues/1796

The commit caused this error for PDCH TS with SysmoBTS:

DL1P <0007> l1_if.c:164 Tx L1 prim MPH-ACTIVATE.req
DL1C <0006> oml.c:811 Error activating L1 SAPI PTCCH on TS 7: Invalid parameter
DL1C <0006> oml.c:1089 (bts=0,trx=0,ts=7,ss=0) act failed mark broken due status: -4

Plain PDCH TS show this error but continue to function despite the SAPI
activation failure.

As a side effect, the SAPI activation failure breaks dynamic TS. GPRS
initially works, but the broken status prevents transitions to TCH/* modes
in the BSC:

DRLL <0000> chan_alloc.c:355 Failed to allocate TCH_H channel
DRSL <0004> abis_rsl.c:1656 BTS 0 CHAN RQD: no resources for TCH_H 0x45

Since the commit only enabled PTCCH UL in sysmobts, no other BTS models are
affected. Notice that lc15 still has PTCCH UL disabled all the while, before
and after this commit and its revert.

Also note that PTCCH DL is and has been enabled without problems (see
further above in sapi_dir_pdtch_sapis[]). This is only about PTCCH UL.

Related: OS#1796
Change-Id: Ia59d95c75a8a5d3bd596f55cd1dc0906a6a95f7f
2016-08-12 12:07:04 +00:00
Neels Hofmeyr
37af36e85e sysmo,lc15: ts_connect_as(): log error also for pchan_as == TCH/F_PDCH
Change-Id: I76c868a1e70af16268a6fa42dc736cf0b288ecdb
2016-08-10 18:06:20 +02:00
Neels Hofmeyr
63849ebf71 dyn TS: measurement.c: replace fixme with comment
Change-Id: I04668f6f01a48157a98c6326a9ee48982a09ee62
2016-08-10 18:06:20 +02:00
Neels Hofmeyr
67a056c122 dyn TS: complete for TRX
Apply similar fixes as for TCH/F_PDCH also for TCH/F_TCH/H_PDCH:

Detect dyn TS in PDCH mode in ts_is_pdch().

In trx_set_ts(), enhance the "if (TCH_F_PDCH)" to a switch statement including
both dynamic channel types. Adjust the comment to include both kinds.

Change-Id: I6669739cd08780cd9ffb9451cdae9f6b9704c4fe
2016-08-10 18:06:20 +02:00
Mike McTernan
ef8e2ef681 osmo-bts-trx: log decoder bit errors as DEBUG, not NOTICE
It is not an exceptional situation if the air-interface is experiencing
non-recoverable decoding errors.  At bad signal conditions and/or
interference, this is perfectly normal.  Let's use DEBUG instead of
NOTICE log level.

Change-Id: Ifd39c53ec22f57cdb5299e5d76ff6ff1482d3beb
2016-08-08 17:46:34 +00:00
Mike McTernan
b7cdd381d6 osmo-bts-trx: Fix PCS1900 operation
As the ARFCN numbers in DCS (1800) and PCS (1900) are not unique,
we need to specify the band in the upper bits of the ARFCN value before
calling gsm_arfcn2freq10().

Change-Id: I637b76bc1fc749eed8e364412d76606589991c02
2016-08-08 17:45:25 +00: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
Holger Hans Peter Freyther
b0f8fa8143 ci/spatch: Remove the "static" analysis handling
spatch on Debian 8.0 has already crashed twice and is likely to
crash more and at the same time the value for this static checking
is close to zero (nice idea but never blossomed). So let's remove
it, have a more reliable build and let's coverity find those issues.

Change-Id: Ic1004edf7f0bee8dda30b95554a0aaf0b116b6b8
2016-08-08 14:34:52 +00:00
Harald Welte
44663c17e7 Add .mailmap for mapping mail addresses in shortlog
Change-Id: I4789197e18fba6b1a376dc8645fdffa6120f6698
2016-08-08 11:31:00 +00:00
Tom Tsou
d6920df630 trx: Fix coverity BER calculation NULL dereference
Allow output of encoded bit count or error count on BER calculation
without requiring both pointers to exist.

Change-Id: I2c78fa6a92a3b3da4aad8f70353e5a43451b0aa5
Fixes: Coverity CID 137963
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-07-28 11:48:25 -07:00
Neels Hofmeyr
af3443385b dyn PDCH: trx l1_if.c: drop fixme, add comment
Change-Id: Ib240f21f4d460524767f4273fc9077617d1ffb43
2016-07-28 17:58:40 +02:00
Neels Hofmeyr
0d4b37d641 dyn PDCH: complete for trx: implement bts_model_ts_[dis]connect()
bts_model_ts_disconnect() has nothing to do.

bts_model_ts_connect() merely sets the new pchan on the ts.

Change-Id: Ieb66935d6efc26854e95d238e810c4f8b16cfa88
2016-07-28 17:58:05 +02:00
Neels Hofmeyr
45d3bbfb44 dyn PDCH: trx l1_if.c: factor out trx_set_ts_as_pchan() from trx_set_ts()
To be able to set a specific pchan type for dynamic channels, have the
trx_set_ts_as_pchan() function with an explicit pchan argument instead of
using ts->pchan.

Keep trx_set_ts() as a thin wrapper to use ts->pchan directly.

Change-Id: I9eeef05d2a6763f86a5b89ee7c3b4211f6736e4d
2016-07-28 17:58:05 +02:00
Neels Hofmeyr
576071d6ca dyn TS, dyn PDCH: common/l1sap.c: properly notice PDCH
In l1sap_ph_rts_ind(), l1sap_ph_data_ind() and to_gsmtap(), the decision
to handle a TS as PDCH was still missing for dynamic TS.

It is not yet clear why this did not impact functionality for dynamic timeslots
on other BTS models. AFAICT they should not work without this patch, but in
fact they do. It would be nice to clarify this some day.

Change-Id: I7b873a089a3de70d980885a7539cb91997464743
2016-07-28 17:58:05 +02:00
Max
5069c1c518 octphy: fix build
The error was introduced in 61372a20de.

Change-Id: I9585eec018b88c5d0548a0a55fa4130bb26aa5b6
2016-07-28 09:52:53 +00:00
Max
108b60faba Fix dsp tracing at phy config
Due to missing runtime cmd patching DSP tracing was not possible at phy
level of config file. No it is possible to specify it as follows:

...
phy 0
 instance 0
  dsp-trace-flag debug
  dsp-trace-flag mph_cnf
...

Change-Id: Ibbbf81d2c4b5d3adbcbc1f08a844d262e603e571
2016-07-28 09:38:04 +00:00
Vadim Yanitskiy
ba656fff91 pcu_sock: use osmo_sock_unix_init() from libosmocore
Since the osmo_unixsock_listen() was moved to libosmocore
it would be better to use the library's implementation
instead of reinventing the wheel again.

Change-Id: Id5828649d44ef11e70946793696b0d689d6b35e3
2016-07-28 09:29:03 +00:00
Neels Hofmeyr
2b34ae32cf fix comment in common/l1sap.c, function name changed
Change was in 334df9441a
"cosmetic: clarify TCH/F_PDCH related naming and comments"

Change-Id: If3e353ea5796ee129bdd95e5f954e6c141cffec8
2016-07-28 06:31:24 +00:00
Max
53d792c3b0 Activate PTCCH UL
So far PTCCH was activated for DL but not for UL. Fix it.

Change-Id: I4fb5ecdfff1a6b8e8d77f561a9cf780f8e116f4d
Related: OS#1545
2016-07-28 06:21:21 +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
Tom Tsou
9407e644b0 trx: Add EGPRS coding and decoding procedures
Handles uplink decoding and downlink encoding procedures for MCS 1-9.
Includes Type 1, 2, and 3 headers and tables from 3GPP TS 44.060 in
order to independently recover coding and puncturing scheme (CPS)
parameters for each coded message.

Change-Id: I0f059ae34c6f36179553cbc972f8becf8179eb55
Signed-off-by: Tom Tsou <tom.tsou@ettus.com>
2016-07-28 06:18:12 +00:00
Neels Hofmeyr
e07ba54d62 dyn TS: sysmo,lc15: chan_nr_by_sapi(): add missing assertion
Addition of GSM_PCHAN_TCH_F_TCH_H_PDCH should have added these assertions.
They clarify that only 'real' pchan types are expected in this function.

Change-Id: Ifd4b6820861ef716237e7eeed149b2add9e7d485
2016-07-27 16:24:52 +02:00
Neels Hofmeyr
a888e95efa log typo: trx_sched_set_pchan()
Change-Id: Icdb193ec6dbb95cf0c3e441c196b309aa599efe6
2016-07-27 16:24:47 +02:00
Neels Hofmeyr
dd34540ce4 comment typo: common/l1sap.c
Change-Id: I053766452ee01bed6136a9742551c664666a7989
2016-07-27 16:22:46 +02:00
Neels Hofmeyr
7b186adb0a dyn TS: implement litecell15 specifics
For chan_nr_by_sapi(), add GSM_PCHAN_TCH_F_TCH_H_PDCH to pick_pchan().

Add GSM_PCHAN_TCH_F_TCH_H_PDCH to pchan_to_logChComb[] for first pchan
initialization.

In ts_connect_as(), make sure that callers pass proper "real world" pchan
types, i.e. reject the "meta" GSM_PCHAN_TCH_F_TCH_H_PDCH pchan constant.

In ts_opstart(), connect as PCHAN_NONE since we will only know the desired
pchan when the first RSL chan activ is received.

Add GSM_PCHAN_TCH_F_TCH_H_PDCH to lchan_to_GsmL1_SubCh_t(), by using its
current "real" pchan mode.

Call cb_ts_[dis]connected() unconditionally, i.e. not only for TCH_F_PDCH when
a pending flag is set. The cb_ts_[dis]connected() will be a no-op if the pchan
type is not dynamic.

Change-Id: Ie30323f968da25027045c42a7ae7f1e70ca711ae
2016-07-25 22:13:44 +02:00
Neels Hofmeyr
b0f77ce685 lc15/oml.c: rename ts_connect() to ts_opstart()
ts_connect() is only called during OPSTART. Name it such because a special
case for OPSTART will be added there for dyn TS.

Change-Id: Iba6880d94142096a8371b08f7404035912cadbb0
2016-07-25 22:13:44 +02:00
Neels Hofmeyr
090a41f897 dyn TS: implement SysmoBTS specifics
For chan_nr_by_sapi(), add GSM_PCHAN_TCH_F_TCH_H_PDCH to pick_pchan().

Add GSM_PCHAN_TCH_F_TCH_H_PDCH to pchan_to_logChComb[] for first pchan
initialization.

In ts_connect_as(), make sure that callers pass proper "real world" pchan
types, i.e. reject the "meta" GSM_PCHAN_TCH_F_TCH_H_PDCH pchan constant.

In ts_opstart(), connect as PCHAN_NONE since we will only know the desired
pchan when the first RSL chan activ is received.

Add GSM_PCHAN_TCH_F_TCH_H_PDCH to lchan_to_GsmL1_SubCh_t(), by using its
current "real" pchan mode.

Call cb_ts_[dis]connected() unconditionally, i.e. not only for TCH_F_PDCH when
a pending flag is set. The cb_ts_[dis]connected() will be a no-op if the pchan
type is not dynamic.

Change-Id: Iaffd2fc0aa9fc6c4a2acbc534ce6384392e0635b
2016-07-25 22:13:44 +02:00
Neels Hofmeyr
78458a3811 sysmo/oml.c: rename ts_connect() to ts_opstart()
ts_connect() is only called during OPSTART. Name it such because a special
case for OPSTART will be added there for dyn TS.

Change-Id: I09cc81e79661e8084aeebf8132435c207b2cf422
2016-07-25 22:13:44 +02:00
Neels Hofmeyr
21ffe07894 dyn TS: common TCH/F_TCH/H_PDCH implementation
common/l1sap: For dyn TS, the BSC will issue RSL Chan Activ requests with a
non-standard chan_nr. While the rest of the code now understands that, the L1
phy will not. Translate to standard PDCH (== TCH/F).

common/oml: use dyn TS' current pchan mode for lchans config.

common/pcu_sock: detect desired PDCH mode of dyn TS.

common/rsl: implement reconnection chain of a TS for changing its pchan:

* rsl_rx_chan_activ():
** Add dyn_pchan_from_chan_nr() to derive the requested pchan from the RSL
   chan_nr IE.
** Notice the need for a pchan change and invoke dyn_ts_l1_reconnect() (s.b.)
** Make Chan Mode IE presence optional, because the non-standard PDCH
   activation message is simpler and does not require it.
** Do PDCH activation via PCU.

* Add dyn_ts_l1_reconnect(): store state and disconnect the L1 channel;
  then wait for cb_ts_disconnected().

* Add osmo_dyn_ts_disconnected() to cb_ts_disconnected():
  verify state and connect with the new pchan type; then wait for
  cb_ts_connected().

* Add osmo_dyn_ts_connected() to cb_ts_connected(), which re-issues
  the cached chan activation message from before disconnecting the L1 channel.

* Also send an rf chan rel/act ack for dyn TS upon PDCH de/act via PCU.

* Add dyn_ts_pdch_release(): on channel release of a dyn TS in PDCH mode,
  release via the PCU. Call from rsl_rx_rd_chan_rel().

Change-Id: I463bb6b4e57674f091c3badba9257374961c52c7
2016-07-25 22:13:44 +02:00
Neels Hofmeyr
6e656748b7 code dup: join [rsl_]lchan_lookup() from libbsc and osmo-bts
lchan_lookup in openbsc abis_rsl.c and rsl_lchan_lookup() rsl.c are the
same code, except for the log context, which is only set in abis_rsl.c.
The common code was factored out to gsm_data_shared.c in openbsc.git.

Use the *rc return code argument to keep the logging part in the newly
introduced thin wrapper lchan_lookup() in common/rsl.c. This also removes code
dup for logging

The rsl_lchan_lookup() implementation is removed from osmo-bts, so a recent
openbsc is needed to build this.

Change-Id: Ibc469b75e31560271be8633d524366442d27e6fb
2016-07-25 22:13:44 +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
Neels Hofmeyr
c9582ac2d7 prepare dyn TS: split/replace conf_lchans_for_pchan()
Move the actual switch from static conf_lchans_for_pchan() into new 'public'
function conf_lchans_as_pchan(), adding an explicit pchan argument. This allows
passing a non-trivial pchan, for dynamic TS.

conf_lchans_as_pchan() now takes a pchan argument, so distinguish the naming
and drop the 'for_pchan' from conf_lchans_for_pchan(), which takes only a ts
argument.

Change-Id: I8e458501fff5503c243512aeb3469c12b1f2bbc4
2016-07-25 15:22:06 +00:00
Neels Hofmeyr
c57304b65e dyn PDCH: code dup: use conf_lchans_as_pchan()
For ip.access dyn PDCH, call conf_lchans_as_pchan() instead of dup'ing the
pchan-to-lchan switch.

Change-Id: I979828e08953e83ae579a347334536f52939faf0
2016-07-25 15:22:06 +00:00
Neels Hofmeyr
9ab51522da error log: rsl.c: typo x2
Change-Id: I285fdff8260f008d856b9cda811e9fbb936893eb
2016-07-25 15:22:06 +00:00
Neels Hofmeyr
8e22ac3d1a info log: l1sap.c: add '0x' to hex output
Change-Id: If29895de238e586b8298d84b6f0b41e08bea8c91
2016-07-25 15:22:06 +00:00
Neels Hofmeyr
ee2299c8fa fix compiler warning: msg_utils.c: fn_chk() constify arg
The only caller dtx_sched_optional() passes const arrays and a warning was
issued.

Change-Id: I18e0788ef96489d2116a60cae57bd516fe6eae8e
2016-07-25 15:22:06 +00:00
Neels Hofmeyr
95dec9ff4a cosmetic: pcu_sock.c: rename ts_is_pdch() to ts_should_be_pdch()
The function checks whether to switch a TS to/from PDCH, not whether it already
is PDCH.

Change-Id: Ib4036445d09792636bb2f1a8a665b6b28f32e1a0
2016-07-25 15:22:06 +00:00
Neels Hofmeyr
334df9441a cosmetic: clarify TCH/F_PDCH related naming and comments
We're about to introduce a new kind of dynamic channel, which will also use
parts of the ip.access mode dyn PDCH code paths. Make sure the general parts
have general names and mark ip.access specific parts as such.

Rename dyn_pdch_ts_[dis]connected() to cb_ts_[dis]connected().
Rename dyn_pdch_complete to ipacc_dyn_pdch_complete().
From cb_ts_[dis]connected(), factor out the current code into static
functions ipacc_dyn_pdch_[dis]connected() -- this will make sense once the
new dynamic kind is added to cb_ts_[dis]connected().

Change-Id: I7da5b7cb7b48572671f50e0dec97d9eec3083df1
2016-07-25 16:38:18 +02:00
Neels Hofmeyr
290c7d954f cosmetic: pcu_sock.c: rename ts_is_pdch() to ts_should_be_pdch()
The function checks whether to switch a TS to/from PDCH, not whether it already
is PDCH.

Change-Id: Ib4036445d09792636bb2f1a8a665b6b28f32e1a0
2016-07-25 16:38:18 +02:00
Neels Hofmeyr
7f1365c05e fix compiler warning: msg_utils.c: fn_chk() constify arg
The only caller dtx_sched_optional() passes const arrays and a warning was
issued.

Change-Id: I18e0788ef96489d2116a60cae57bd516fe6eae8e
2016-07-25 16:38:18 +02:00
Neels Hofmeyr
2479ef4133 info log: l1sap.c: add '0x' to hex output
Change-Id: If29895de238e586b8298d84b6f0b41e08bea8c91
2016-07-25 16:38:18 +02:00
Neels Hofmeyr
ae65ccd0b2 error log: rsl.c: typo x2
Change-Id: I285fdff8260f008d856b9cda811e9fbb936893eb
2016-07-25 16:38:18 +02:00
Neels Hofmeyr
8a2f026cf0 doc: move dyn_pdch.msc to osmo-gsm-manuals.git
Also remove related cruft: .gitignore, msc-README and adjust an in-code
comment that referenced dyn_pdch.msc.

Change-Id: Ie41a453bb5070c1f18793f646dc053a978f43fba
2016-07-25 16:35:53 +02:00
Max
4355021b8a sysmobts: dump PRACH and PTCCH parameters
Change-Id: I6b833b21d2bbbd45dfed6a094a674359762d02b7
Related: OS#1545
2016-07-16 21:00:53 +00:00
Neels Hofmeyr
2ed03cd640 osmo-bts-trx: init OML only once by sending AVSTATE_OK with OPSTATE_ENABLED
When receiving an OPSTART for the BTS object, also set the availability state
to OK.

Before, the availability would remain at NM_AVSTATE_DEPENDENCY, which caused an
unfortunate chain reaction resulting in osmo-bts-trx going through the
initialization sequence twice:

  BTS    BSC
   |<-----|   SITE_MANAGER OPSTART
 n |----->|   BTS state change: OPSTATE_DISABLED, AVSTATE_DEPENDENCY
 o |      |     This signals to nm_statechg_event() in bts_ipaccess_nanobts.c
 r |      |     to (a) Set BTS Attributes and (b) send BTS OPSTART
 m |<-----|   Set BTS Attributes (a)
 a |      |     When osmo-bts-trx receives a Set BTS Attributes, it sends
 l |----->|   CHANNEL state change: OPSTATE_DISABLED  x8
   |      |     This signals the BSC to Set CHANNEL Attributes and OPSTART
 i |<-----|   Set CHANNEL Attributes  x8
 n |<-----|   CHANNEL OPSTART  x8
 i |----->|   CHANNEL state change: OPSTATE_ENABLED, AVSTATE_OK  x8
 t |      |
   |<-----|   BTS OPSTART (b)
   |      |     osmo-bts-trx immediately replies with:
   |----->|   BTS state change: OPSTATE_ENABLED, AVSTATE_DEPENDENCY
   |      |     Unfortunately, availability is left at DEPENDENCY,
   |      |     and the NM_OC_BTS case in nm_statechg_event() only
   |      |     checks for availability, not for the opstate.
   |      |     Hence nm_statechg_event() again feels inclined to
   |      |     to (a) Set BTS Attributes and (b) send BTS OPSTART,
   |      |
 --+------+----- This is where the second round starts
   |      |
 s |<-----|   Set BTS Attributes (a)
 e |      |     When osmo-bts-trx receives a Set BTS Attributes, it sends
 c |----->|   CHANNEL state change: OPSTATE_DISABLED  x8
 o |      |     All channels are disabled again, and then re-launched:
 n |<-----|   Set CHANNEL Attributes  x8
 d |<-----|   CHANNEL OPSTART  x8
   |----->|   CHANNEL state change: OPSTATE_ENABLED, AVSTATE_OK  x8
   |      |
 i |<-----|   BTS OPSTART (b)
 n |      |     osmo-bts-trx again sets the OPSTATE_ENABLED, but since
 i |      |     this time it was already enabled, no further state change
 t |      |     is sent back to the BSC.

This nightmare pivots on two hinges:

1. osmo-bts-trx fails to set BTS availability to AVSTATE_OK.
2. nm_statechg_event() fails to heed the OPSTATE_ENABLED of the BTS state
   change.

Note, the configured channels from the first round were not actually taken
down, only the OML OPSTATE_DISABLED were sent.

In this commit, fix the osmo-bts-trx side: send AVSTATE_OK for the BTS object
upon sending OPSTATE_ENABLED, so that only the part marked "normal init" above
is run.

This change applies the same fix to other OML objects, which should make sense
in the same manner, within the current hackish OML implementation:
* NM_OC_BTS
* NM_OC_SITE_MANAGER
* NM_OC_BASEB_TRANSC
* NM_OC_GPRS_NSE
* NM_OC_GPRS_CELL
* NM_OC_GPRS_NSVC

This means that the NM_OC_CHANNEL case just above is identical, and thus
collapse NM_OC_CHANNEL onto the other cases. Drop the comments from
NM_OC_CHANNEL since they merely rephrase the commands themselves.

See OS#1770 for BTS and NITB logs.

Fixes: OS#1770

Change-Id: I08aa861f6100568c79750f4fbc9a32e1557b9304
2016-07-14 03:40:50 +02:00
Neels Hofmeyr
cff0d44e53 log: osmo-bts-trx: change PDTCH block logs to DEBUG level
Many erratic PDTCH blocks are expected. To not bloat the log,
notifications for this should be on debug level.

See http://lists.osmocom.org/pipermail/openbsc/2016-June/009457.html
(Thu, 30 Jun 2016 01:49:33 +0300 / Alexander Chemeris
<alexander.chemeris@gmail.com> / Re: GPRS on osmo-trx not working)

Change-Id: Ie318248aa2b8de455174e72a63c602c7aeae312c
2016-07-09 19:52:18 +00:00
Neels Hofmeyr
b8f5f4e176 log: osmo-bts-trx: change access burst logs to DEBUG level
Many erratic bursts are expected. To not bloat the log, notifications for this
should be on debug level.

See http://lists.osmocom.org/pipermail/openbsc/2016-July/009482.html
(Tue, 5 Jul 2016 15:38:27 -0700 / Tom Tsou <tom@tsou.cc>
/ Re: osmo-bts-trx error logs -- was: GPRS on osmo-trx not working)

Change-Id: If591c087ba8fd48564139e32930050ee8ab07001
2016-07-09 19:50:50 +00:00
Neels Hofmeyr
b151301c6c cosmetic: osmo-bts-trx: add comment, fix comment typo
Change-Id: Iea62bd98954d0219ba597613cea6db63f7a6b396
2016-07-09 19:50:50 +00:00
Holger Hans Peter Freyther
1c1b0e843d sysmobts: Fix eeprom padding before gpg key
Correct the too short padding I introduced in the commit
a55b166c6c. The result needs to
be 121 and not 120. Add static asserts to make sure it does
not happen again.

Change-Id: I3da7f3b8d3c8e12deb8b805cd15ff52a103d4e56
2016-07-07 13:51:00 +00:00
Max
e3edc17426 Mark array as static const
Change-Id: Ia70519c8f10d55084b53acb68e57debc70549246
2016-07-05 14:48:26 +02:00
Harald Welte
7267a0d37e sysmobts: screnrc/systemd-service: Use osmo-bts-sysmo instead of sysmobts
Back in January in commit 634c3e4648 we
changed the executable name from 'sysmobts' to 'osmo-bts-sysmo', which
is a change that has not been propagated to the contributed screenrc and
systemd init files.

Change-Id: I875a0ce4f470226e1b06ed1b7c74ca9471ebb574
2016-06-27 13:50:25 +02:00
Max
d5f95c308b TRX: add Uplink DTX support for FR/HR
* detect SID and set RTP Marker accordingly (emulate ONSET events)
* set proper FN in TCH_IND
* detect speech pause and do not send dummy 'bad' frames during that
  time

Change-Id: Id518e5c667df7773c281effb9e75b66bf898f6fc
Related: OS#1750
2016-06-27 09:37:11 +00:00
Max
bb1e3b089b Remove duplicated nibble shift code
Those functions are now part of libosmocore.

Change-Id: Iab3206e3b41caff23f656a727605032df9798953
2016-06-24 10:47:59 +02:00
Max
c03d3ae7af DTXu: move copy-pasted code to common part
Abstract code for checking/setting lchan's UL SID flag and RTP Marker
into generic function and use it for LC15 and sysmoBTS.

Change-Id: Ica5392e92bab29164711163e7b01adb174272883
Related: OS#1750
2016-06-23 20:01:02 +00:00
Max
5c0d88e69d Make get_lchan_by_chan_nr globally available
* Remove static qualifier
* Remove duplicated code - use generic function instead

Change-Id: I37a312648771f58d3087471083cfcebbd97ccf1d
2016-06-23 20:00:44 +00:00
Neels Hofmeyr
4fa641d7b2 fix compiler warning: remove unused variable 'i' in calib_verify()
Change-Id: Iea6bc47182d021523285aea8d3f6a93ee4eec0eb
2016-06-23 19:58:47 +00:00
Neels Hofmeyr
64e3813b06 fix compiler warning: remove useless 'static' storage class for struct decl
Change-Id: I4d5d11dd89449e4c9315f963576265bccad7e68c
2016-06-23 19:58:47 +00:00
Neels Hofmeyr
9797a72cd7 fix compiler warnings: include bts_model.h in phy_link.c
The file calls bts_model_* API which was yet undeclared.

Change-Id: Ib6b30d125906c3abae518fb76da3a158885e3354
2016-06-23 19:58:47 +00:00
Neels Hofmeyr
99642656a0 vty: install orphaned trx nominal power command
The cfg_trx_nominal_power_cmd added 12 days ago in
58e4e18206 was floating.
Actually add it to the TRX_NODE.

Change-Id: I89d638b2e2bb1fb9baeabe566035ff171f4bfad0
2016-06-22 23:33:36 +00:00
Neels Hofmeyr
c2874c4360 dyn PDCH: safeguard: exit if nothing pending in dyn_pdch_ts_disconnected()
The function would currently only be called in cases where one of the if
branches catches on, but for safety's and clarity's sake, don't ts_connect
using as_pchan if no reconnect is pending.

Change-Id: I52c34065254e902bb80662fc04540901b36cb4c3
2016-06-22 23:31:06 +00:00
Neels Hofmeyr
3f919171ef dyn PDCH: lc15: complete for litecell15-bts: implement bts_model_ts_*()
Analogous to 63b296bdd9 on osmo-bts-sysmo.

Implement bts_model_ts_disconnect() by sending an MphDisconnect message to L1.
Pass a disconnect callback to invoke dyn_pdch_ts_disconnected() in
common/rsl.c.

Implement bts_model_ts_connect() by calling ts_connect_as(). Pass a connect cb
to invoke dyn_pdch_connected() in common/rsl.c.

Change-Id: I8c8c3244c726fd6055cedb22ee11706994ff9cd4
2016-06-22 23:26:15 +00:00
Neels Hofmeyr
a4c6802315 dyn PDCH: lc15: handle TCH/F_PDCH init like TCH/F
Analogous to 57fc1124e1 on osmo-bts-sysmo.

Change-Id: If65c5a86cbc1b5556b71de8a6744d92113fbbcba
2016-06-22 23:26:07 +00:00
Neels Hofmeyr
0eaa27a6be dyn PDCH: lc15: add ts_connect_as(), absorbing ts_connect() guts
Analogous to 294fbe104b on osmo-bts-sysmo.

For upcoming dyn PDCH switching, I want to be able to set the pchan dynamically
upon ts_connect() and not continue with OPSTART ACK, but with the dyn PDCH.

Thus recoin ts_connect(ts) to ts_connect_as(ts, pchan, cb) and leave
ts_connect() as a thin wrapper to leave init code unchanged.

Change-Id: I7a27193168f83e8c40b6e54d1842f4502d0475e5
2016-06-22 23:26:01 +00:00
Neels Hofmeyr
037dcfe981 dyn PDCH: lc15: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags
Analogous to 0d10f0e482 on osmo-bts-sysmo.

According to the PDCH Active flag, handle a TS as TCH/F or PDCH.

Change-Id: I0c97b360136f76bdae8d70d06af9a31fdf75c1ba
2016-06-22 23:25:54 +00:00
Neels Hofmeyr
380a2e6d90 lc15: add L3 handle to l1prim messages
Analogous to 7158c2ed08 in osmo-bts-sysmo.

Place a layer 3 handle into GSM L1 messages to better match up confirmations to
respective requests. This handle is a uint32_t transparently returned in the
confirmation messages, so a match-up is easy to add.

So far, a GSM L1 confirmation message received for a preceding L1 Request was
matched only by the prim_id. That meant that only one instance of the same
primitive could be waiting for a confirmation at any given time, or the
responses would get mixed up: the struct wait_l1_conf instances entered into
the fl1h->wlc_list queue would be returned to a possibly mismatching
confirmation handler. (Seen during testing of dyn pdch switching.)

Send the hLayer3 handle out via prim_init(), using new static functions to
produce handles on different scopes:

* l1p_handle_for_trx()
* l1p_handle_for_ts()
* l1p_handle_for_lchan()

(These could possibly move to a more general .h/.c file later.)

Remember the hLayer3 handle in

* struct wait_l1_conf.

Match the incoming confirmations' and stored hLayer3 handles up in, and remove
a now obsolete comment from:

* is_prim_compat()

Since the hLayer3 members are at different byte offsets in
GsmL1_Prim_t.u.*, use large switch statements to set/get the value:

* In prim_init(), extend existing switch statement to set in GsmL1_Prim_t.
* Add l1p_get_hLayer3() to retrieve from GsmL1_Prim_t (could possibly move to a
more general .h/.c file later).

Note that some messages are already using the hLayer3 handle, and will
overwrite it after calling prim_init(), so those are not affected.

Change-Id: I17f95ba744c3e944a2241809106506f8dd1b24f0
2016-06-22 23:25:43 +00:00
Neels Hofmeyr
ccb1148717 fix lc15 build: put src/common/libbts.a left of -losmogsm
When switching to the gsm_chan_t_names string list from libosmogsm,
libosmogsm actually became a dependency of the local libbts.a.

The breaking change is in openbsc.git 29048b2a80b5865ffc41fa4401113c5826227e23
and came in here because gsm_data_shared.h is included from openbsc.

Change-Id: I70e5735fc2a212305182d46a7e8485d0199ade7b
2016-06-22 23:25:27 +00:00
Max
724412a49a Clarify logging message
Change-Id: I3c7be592f4cbdd553f07c4a7084478706a7bd644
Related: OS#1648
2016-06-22 23:24:43 +00:00
Max
f0d6d6ba02 Use error values instead of number for RSL error
Change-Id: I0aa695c42a4399828fb8e9c08c905870175b7149
2016-06-21 17:52:01 +02:00
Max
dd084e6e57 Use libosmocodec functions for AMR
Switch to using libosmocodec functions as a preparation step for DTX
support as they expose necessary bits.

Change-Id: Ie7423032fd06779d78876182ee63538d98906328
Related: OS#1750
2016-06-21 17:24:50 +02:00
Max
61372a20de Move copy-pasted code into common part
Related: OS#1750
Change-Id: Ic4342eaf7e32a0e9a5f2b16dd196a1f5f03152a9
2016-06-18 11:35:12 +00:00
Max
c3fb0dcc8c DTX: add support for AMR/HR
Change-Id: Id744b67904011eb328b24c46a645b3eb53525c04
Fixes: OS#1562
2016-06-18 11:34:51 +00:00
Neels Hofmeyr
274d29bedd debug log: log TS pchan type on connect
A whitespace error is fixed along the way.

Change-Id: Iff373ba934937435a175ed3a5d9cfb6f2514735d
2016-06-17 15:50:48 +00:00
Neels Hofmeyr
7efc2f3c5b debug log: log lchan state transitions
Change-Id: Id20f61ef535f4ea049da6579e41eb98f31238d23
2016-06-17 15:50:48 +00:00
Neels Hofmeyr
b231e0f6cd error log: two minor clarifications
Change-Id: I95e4331f51f650d5077eb3a8f897f754d5d2b779
2016-06-17 15:50:48 +00:00
Neels Hofmeyr
63b296bdd9 dyn PDCH: complete for sysmo-bts: implement bts_model_ts_*()
Implement bts_model_ts_disconnect() by sending an MphDisconnect message to L1.
Pass a disconnect callback to invoke dyn_pdch_ts_disconnected() in
common/rsl.c.

Implement bts_model_ts_connect() by calling ts_connect_as(). Pass a connect cb
to invoke dyn_pdch_connected() in common/rsl.c.

Change-Id: I61709fdf6b093689a6d3a046f67db6d02f1296ae
2016-06-17 15:50:48 +00:00
Neels Hofmeyr
57fc1124e1 dyn PDCH: sysmo: handle TCH/F_PDCH init like TCH/F
Change-Id: Ic62921e17c55aeb26235b70a8325d6fea1716cef
2016-06-17 15:50:48 +00:00
Neels Hofmeyr
294fbe104b dyn PDCH: sysmo-bts/oml.c: add ts_connect_as(), absorbing ts_connect() guts
For upcoming dyn PDCH switching, I want to be able to set the pchan dynamically
upon ts_connect() and not continue with OPSTART ACK, but with the dyn PDCH.

Thus recoin ts_connect(ts) to ts_connect_as(ts, pchan, cb) and leave
ts_connect() as a thin wrapper to leave init code unchanged.

Change-Id: I09cc794cb424e17411e608c65f2b68e2f2544e07
2016-06-17 15:50:48 +00:00
Neels Hofmeyr
24a31cfe43 dyn PDCH: implement main dyn PDCH logic in common/
React on IPAC PDCH ACT and DEACT messages and invoke the PCU and bts_model_ts_*
APIs to effect switchover. The dyn PDCH interaction is described in the comment
to rsl_rx_dyn_pdch(), the main entry point for PDCH switchover.

In case the bts_model_ts_* are not implemented (or return other errors),
reply with an IPAC PDCH ACT/DEACT NACK.

Add callbacks that mark steps in the PDCH switchover process,
dyn_pdch_ts_disconnected(), dyn_pdch_ts_connected() and dyn_pdch_complete().

Add hooks in l1sap.c on channel activation and release confirmation, to call
dyn PDCH callbacks.

BTS dyn PDCH implementations should invoke dyn_pdch_ts_disconnected() and
dyn_pdch_ts_connected() when bts_model_ts_disconnect() or
bts_model_ts_connect() are called, respectively. (upcoming for sysmoBTS)

Change-Id: Id2f5f77121a65d6c14eac127b3d4fb50e97a77ab
2016-06-17 15:50:48 +00:00
Neels Hofmeyr
0d10f0e482 dyn PDCH: chan_nr_by_sapi(): handle TCH/F_PDCH according to ts->flags
According to the PDCH Active flag, handle a TS as TCH/F or PDCH.

Change-Id: I06ca26a99f052c6a2ae953fe355fd1196f66e501
2016-06-17 15:50:47 +00:00
Neels Hofmeyr
f8bf95fa6b dyn PDCH: pcu_tx_info_ind(): handle TCH/F_PDCH in PDCH mode
Introduce a static function to encapsulate the decision whether a TS is
used for PDCH. Depending on the ts->flags, handle a TCH/F_PDCH TS exactly like
a standard PDCH TS.

Change-Id: Ic72fd06ecc99609823efa3edcf773007cc514b5b
2016-06-17 15:50:47 +00:00
Neels Hofmeyr
e6cc04827a dyn PDCH: conf_lchans_for_pchan(): handle TCH/F_PDCH
Depending on the PDCH active flag, handle a TCH/F_PDCH like TCH/F or PDCH.

Change-Id: Ifc5561f8e2db172bb692ba26bdeae2fd675d6ec5
2016-06-17 15:50:47 +00:00
Neels Hofmeyr
9375aa9a68 dyn PDCH: add bts_model_ts_connect() and _disconnect() stubs
Enhance bts_model_ API in preparation of dyn PDCH switching. These will be used
to re-connect a TCH/F_PDCH TS in a different mode: either as TCH/F or as PDCH.

All implementations so far return -ENOTSUP, and thus will cause a IPAC PDCH ACT
or DEACT *NACK* to be sent to the BSC as soon as these messages are handled.

Also add stubs in tests.

Change-Id: I21e60c028a1333431c3ed000f788b654d1170b0d
2016-06-17 15:50:47 +00:00
Neels Hofmeyr
bfc9ff3118 fix two compiler warnings: add two opaque struct declarations
Change-Id: Ie12eeff753e399b28a816893ac4d23e1cd391025
2016-06-17 15:34:57 +00:00
Neels Hofmeyr
6b60611a4d fix compiler warning: add missing case (PHY_LINK_CONNECTING)
Change-Id: I7979e10551023c1f52f04b4e93ea1706cf0bef39
2016-06-17 15:34:48 +00:00
Neels Hofmeyr
bc9c42663d fix compiler warning: printf format for sizeof()
Change-Id: Id600c5a34ab261736f7595ab2e36e3a30d434175
2016-06-17 15:34:42 +00:00
Max
8a75e60d0c Add .gitreview
Similar to other projects, add helper file for "git review"
command. More information:
https://www.mediawiki.org/wiki/Gerrit/git-review

Change-Id: If3406fafa5778e94ab53e858ddda4a4d55651879
2016-06-17 15:33:01 +00:00
Max
ae2a8b75f9 TRX: add configuration example
Related: OS#1648
Change-Id: Icc7d15eceee8ee667fd6a29e758a38668c4946ef
2016-06-17 15:32:28 +00:00
Neels Hofmeyr
3686005180 add missing DSUM entry to bts_log_info_cat
This allows setting the 'sum' log level to debug in osmo-bts.cfg.

Change-Id: I1fe1a483f07f0384815f01877f86ffc192052f72
2016-06-17 15:32:03 +00:00
Neels Hofmeyr
ea40bd60e7 doc: add ladder diagram on dynamic PDCH, add msc-README
Adjust .gitignore for dyn_pdch.svg and .png.

Change-Id: I532f896b1b528c4d1764bb5042a7f42c3c60f617
2016-06-17 02:46:12 +00:00
Neels Hofmeyr
a8168271eb dyn PDCH: cosmetic: lchan_to_GsmL1_SubCh_t(): add case for TCH_F_PDCH
It is cosmetic since the 'default:' case already caught TCH_F_PDCH, but it's
good to mention all expected pchans explicitly.

Change-Id: I5aef84209e46c9288f6adf0730178fe08f26764f
2016-06-17 04:26:20 +02:00
Neels Hofmeyr
e951042475 dyn PDCH: rsl rx dchan: also log ip.access message names
Before, only standard ABIS RSL message names were logged, add ip.access
specific ones.

The IPAC_PDCH_ACT and _DEACT msgs are received with an ABIS_RSL_MDISC_DED_CHAN
discriminator, and not with _MDISC_IPACCESS like the others. Thus rsl_rx_dchan()
should be able to log ip.access message types properly.

Change-Id: I9db6826b515bf565fc7ae24fc0760b60928cc89f
2016-06-17 04:24:57 +02:00
Neels Hofmeyr
65efa691f8 oml, Set Chan Attr: treat unknown PCHAN types as error
Change-Id: Id79585993df15362ba0e1271d03302597182ceff
2016-06-17 01:31:03 +00:00
Neels Hofmeyr
6ab1ed580d fix typo in error message ('at lEast')
Change-Id: I6ac3606157dc6c81ed17cd6d26227da8ae26c49f
2016-06-17 01:30:08 +00:00
Neels Hofmeyr
213db32e30 tests/stubs.c: remove unused stubs
Change-Id: I53a839a332980bca67ae0b7d3e36b97afe406e5b
2016-06-17 01:30:00 +00:00
Neels Hofmeyr
703c2d6eb8 pcu_sock: add pcu_connected() to query PCU availability
Will be used in upcoming dyn PDCH switching.

Change-Id: I8031089ad5e9cb9690ca7e22facc53438f28e12a
2016-06-17 01:24:25 +00:00
Max
ecd5bc2aef TRX: Add vty command to power on/off transceiver
Add vty command (under "phy X instance Y" hierarchy) to manually send
POWERON or POWEROFF command. It's useful for debugging issues related to
BTS/TRX initialization.

Change-Id: I6dfebaf118cdf5ad144516b2b839b17350a73ce4
Related: OS#1648
2016-06-16 13:39:42 +00:00
Max
7cc3c3156e Fix OML activation
Previously software activation could have been reported multiple times
which broke proper BTS init. Introduce guard variable to ensure
reporting happens only once.

Note: this is just minimal workaround - ideally proper OML state machine
should be implemented.

Change-Id: Ifffbdb756bc5d2864f985c01a3299b839c4de7af
Related: OS#1648
2016-06-16 12:43:44 +02:00
Minh-Quang Nguyen
58e4e18206 LC15: TRX nominal TX power can be used from EEPROM or from BTS configuration
Change-Id: I173f4126cea41959d48def07bff25fcd29894b7e
2016-06-15 09:45:02 +00:00
Minh-Quang Nguyen
cbbce0be09 LC15: Hardware changes:
- Change system devices path
- Remove obsoleted sensors and add new sensors
- Change TRX and sensors numbering to 0,1 instead of 1,2 (JFD)

Change-Id: I5172daf68d3145a6398e37df87df21b0e5affe42
2016-06-15 09:44:58 +00:00
Minh-Quang Nguyen
d0d2c9217a LC15: Bring back DSP trace argument
Change-Id: I822651d9ba4959ce5885a2c0362f1ea583b724da
2016-06-15 09:44:51 +00:00
Neels Hofmeyr
7158c2ed08 sysmo: add L3 handle to l1prim messages
Place a layer 3 handle into GSM L1 messages to better match up confirmations to
respective requests. This handle is a uint32_t transparently returned in the
confirmation messages, so a match-up is easy to add.

So far, a GSM L1 confirmation message received for a preceding L1 Request was
matched only by the prim_id. That meant that only one instance of the same
primitive could be waiting for a confirmation at any given time, or the
responses would get mixed up: the struct wait_l1_conf instances entered into
the fl1h->wlc_list queue would be returned to a possibly mismatching
confirmation handler. (Seen during testing of dyn pdch switching.)

Send the hLayer3 handle out via prim_init(), using new static functions to
produce handles on different scopes:

* l1p_handle_for_trx()
* l1p_handle_for_ts()
* l1p_handle_for_lchan()

(These could possibly move to a more general .h/.c file later.)

Remember the hLayer3 handle in

* struct wait_l1_conf.

Match the incoming confirmations' and stored hLayer3 handles up in, and remove
a now obsolete comment from:

* is_prim_compat()

Since the hLayer3 members are at different byte offsets in
GsmL1_Prim_t.u.*, use large switch statements to set/get the value:

* In prim_init(), extend existing switch statement to set in GsmL1_Prim_t.
* Add l1p_get_hLayer3() to retrieve from GsmL1_Prim_t (could possibly move to a
  more general .h/.c file later).

Change-Id: Ie4533c6cbc160318917e7a672ab6f9a848f01d1b
2016-06-15 09:30:24 +00:00
Holger Hans Peter Freyther
a55b166c6c sysmobts: Add the barebox boot state reservation
We are using up to 48 (actually only 8) bytes to manage the boot
state of the device. Add it to the eeprom reservation. It turns out
the current padding was too large (37 + 84 don't end at 120).

Change-Id: I4c1de5925577f1d0b7b5cc08529642ffa333d7de
2016-06-15 09:33:23 +02:00
Minh-Quang Nguyen
3f3f34ba52 common/abis.c: fix 100% CPU usage after disconnecting OML/RSL link (Bug #1703)
Change-Id: I24605b8a6d4e778a3280ffba8bc1fc7a284ce12d
2016-06-14 21:57:57 +00:00
Minh-Quang Nguyen
495fed9f43 l1sap.h: fix wrong L1SAP_FN2PTCCHBLOCK calculation according to TS 45.002 Table 6
We have seen that the DSP time to time rejects PTCCH message from BTS due to invalid block number.
As a result, we patched FN2PTCCHBLOCK calculation according TS 45.0002 Table 6.


Change-Id: I8be1c8b9159c94788857c6de5440a418739f1212
2016-06-14 21:57:06 +00:00
Max
a10ac248c6 DTXu: mark beginning of speech burst in RTP
Set Marker bit in RTP header to mark the beginning of talkspurt.

Change-Id: I3dd70ad8ff94356e3c3cc5458255f6c23534783e
Related: OS#1562
2016-06-14 10:19:13 +00:00
Max
60970056c8 DTXd: store/repeat last SID
Store last SID received over RTP and repeat is if necessary (no new SID
or SPEECH frames) according to codec-specific scheduling rules.

Related: OS#1563
Copy-paster from I4d23846a27d3dbd2a6e75e481c1efcdb2a85f305 for LC15.

Change-Id: I29acea6e8bbf426330ce52554a48afb5d2ef1679
2016-06-14 10:18:59 +00:00
Max
8ecadc66ce DTXd: store/repeat last SID
Store last SID received over RTP and repeat is if necessary (no new SID
or SPEECH frames) according to codec-specific scheduling rules.

Change-Id: I4d23846a27d3dbd2a6e75e481c1efcdb2a85f305
Related: OS#1563
2016-06-14 10:18:59 +00:00
Max
9302abe054 Fix debug output
Previously frame number was not saved in case of PRIM_TCH rendering many
debug statements with g_time useless.

Copy-paste from ef30f50d5d.

Change-Id: I952b39458d921622d5964cbdcc2f4e45ff9ea951
2016-06-14 10:18:59 +00:00
Jason DSouza
45e97ac59a Close TRX session before opening new one
This fixes the unstable behavior (BTS loosing subscribers after some
time) in case previous run of osmo-bts was interrupted (with ctrl+c for
example).

Change-Id: Ie2119b0b566d01f0e70b38c8a149fecb47def38d
2016-06-14 10:18:43 +00:00
Max
3a1f1b8e91 octphy: Use the app. info. defaults as base
Similar to 91565b2d51 use default
initializers.

Change-Id: Ib813249f4295b034eb65658e3f43b4fe86862cf0
Fixes: Os#1642
2016-06-13 14:56:44 +02:00
Max
4582222757 Use libosmocodec for AMR RTP
Use libosmocodec function to parse RTP with AMR payload in sysmoBTS and
LC15. This replaces "manual" parsing of AMR frame with function covered
by test suite and makes adding DTXd support easier.

Related: OS#1563
Change-Id: I1464f9a12e3f92926d03d5dd5d18e8f0f7206dd9
Reviewed-on: https://gerrit.osmocom.org/204
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-06-12 15:43:19 +00:00
Max
c1586388dc Add DTXd support for sysmoBTS and LC15
* set/clear DTXd activity indicator for measurement reporting
* set DTXd status based on information from RSL

Related: OS#1563
Change-Id: I148a75725c4e5089b6f2da6e9adcbe94170d3257
Depends-On: I4a033b03fcd0deb4db7a38273b5407511dbf1d6c
Reviewed-on: https://gerrit.osmocom.org/220
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-06-12 15:42:34 +00:00
Max
51bfebec39 Fix RTP timestamps in case of DTX
Compute RTP user_ts adjustment based on the difference between current
and previous FN instead of hard-coded value.

Change-Id: If1677ddcf754b29990ff7cd846e11c32e3d30b33
Related: OS#1562
Reviewed-on: https://gerrit.osmocom.org/196
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-06-07 15:32:39 +00:00
Max
ef30f50d5d Fix debug output
Previously frame number was not saved in case of PRIM_TCH rendering many
debug statements with g_time useless.

Change-Id: Ib8d8c919862d0de8e2ebf7753c2592e0d91b09c5
Reviewed-on: https://gerrit.osmocom.org/195
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-06-05 09:35:23 +00:00
Max
201b424b73 Use libosmocore function for uplink measurements
Related: OS#1563
Change-Id: Ide47e8e69e0d2d5859c5249b22f4bad22c18aa57
Reviewed-on: https://gerrit.osmocom.org/108
Tested-by: Jenkins Builder
Reviewed-by: Harald Welte <laforge@gnumonks.org>
2016-05-31 11:58:08 +00:00
Daniel Laszlo Sitzer
0778cd488a octphy: Update outdated config param name in error message.
Change-Id: I45b8bc09c9aabacc5b908450fe574b5802b88be8
Reviewed-on: https://gerrit.osmocom.org/129
Tested-by: Jenkins Builder
Reviewed-by: Holger Freyther <holger@freyther.de>
2016-05-31 09:30:55 +00:00
Max
ed494443cc Ensure TRX invariant
There is implicit invariant in trx_phy_instance() which is actively used
by various hw-specific implementations to get TRX's phy instance. Let's
make sure there's explicit assertion for this because there's been
segfaults in the past related to it.
2016-04-29 13:03:35 +02:00
Holger Hans Peter Freyther
b61850248a jenkins: Add the build script from jenkins here
This can be used to replicate a build issue more easily.
Build specific to the Octphy.
2016-04-13 19:35:32 -04:00
Holger Hans Peter Freyther
c8da1ac9a6 jenkins: Add the build script from jenkins here
This can be used to replicate a build issue more easily.
2016-04-13 19:08:07 -04:00
Holger Hans Peter Freyther
227015e52e misc: Ignore files generated by a debian packaging build 2016-04-01 17:02:11 +02:00
Holger Hans Peter Freyther
460e1b7387 debian: Create initial packaging for the osmo-bts-trx
This is only with osmo-bts-trx as others require headers that are
not packaged yet.
2016-04-01 17:01:54 +02:00
Max
21fc6e45fb LC15: properly initialize unmapped phy instances
Fixes: OS#1665
2016-03-22 19:38:39 +01:00
Max
925fcf48ed LC15: add stubs for phy link/instance defaults 2016-03-22 19:37:03 +01:00
Max
0fe3b215b9 LC15: ignore build byproducts 2016-03-22 19:37:02 +01:00
Max
06968beab9 octphy: fix for multiple trx with more than 1 dsp
Explicitly store and use "center" arfcn used by each dsp (1 dsp
corresponds to 1 phy link).
2016-03-21 17:20:11 +01:00
Max
ae5a737c18 octphy: add example configuration with 2 trx 2016-03-18 15:43:56 +01:00
Max
c4fc00d851 octphy: add support for multiple trx ids 2016-03-18 15:30:30 +01:00
Max
3044a26d71 octphy: use octasic's routines for debug output 2016-03-18 15:29:54 +01:00
Max
b857f27704 Fix typo in error message 2016-03-17 18:23:55 +01:00
Max
9591b6c253 octphy: add missing include to fix the build 2016-03-17 16:23:07 +01:00
Max
bb0cc685f1 Add utility to check proper scheduling of SI
There are several types of System Information messages with tricky
scheduling rules described in 3GPP TS 05.02 § 6.3.1.3. This GNU Awk
script takes in .csv file with sequence of scheduled SI messages (for
example generated using tshark from GSMTAP capture - see usage note
inside the script) and check the scheduling rules compliance.
2016-03-17 13:51:09 +01:00
Max
6044785a22 Ignore binary and backup files
Add missing entries to .gitignore
2016-03-17 13:50:51 +01:00
Max
b2b1112a6e Add explicit check for SI2quater index and count
Right now we do not support multiple SI2quater messages, so return error
if either index or count is non-zero.
2016-03-17 13:50:31 +01:00
Max
f3ee66207d Fix SI2ter scheduling
According to 3GPP TS 05.02 § 6.3.1.3 SI2ter messages should be scheduled
in FN with TC=4 only if SI2bis messages are also available.
2016-03-17 13:48:16 +01:00
Holger Hans Peter Freyther
0be80aa2d1 octphy: Enable TCH/H mode and begin testing
Upcoming releases will support TCH/H and we should start to test
the DSP->RTP code.
2016-03-16 09:17:04 +01:00
Holger Hans Peter Freyther
710e99c2e3 misc: Attempt to fix make distcheck and dumping docs
The file has been renamed, attempt to catch up
2016-03-15 20:09:49 +01:00
Harald Welte
40e8365854 Update configuration examples
Add SysmoBTS-specific example.
Remove outdated generic example which is no longer working.
2016-03-14 18:36:11 +01:00
Max
d5c658b22e Fix copy-paste issue
This issue prevented scheduling of SI 2quater messages.
2016-03-11 22:10:21 +07:00
Holger Hans Peter Freyther
91565b2d51 octphy: Use the event defaults as base
Bad parameters are passed to the event structure and the default
initialization should happen.
2016-03-10 16:15:51 +01:00
Holger Hans Peter Freyther
2278fdc580 pcuif: Do not bump the PCU_IF version
I had accidently bumped the version as I thought that osmo_ph_pres_info_type
was part of the ABI. It is not an only internal to the BTS. Revert
this part of the change.
2016-03-10 16:10:11 +01: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
69b959e557 sysmobts_vty: Fix null-check for pinst
There was a copy+paste error, checking for plink but we should check for
pinst.

This was found by coverity (CID 1351424).
2016-02-15 20:11:43 +01:00
Harald Welte
ad7f7a7117 Merge branch 'laforge/litecell15' 2016-02-15 14:28:50 +01:00
Harald Welte
81cc8cdba5 LC15: remove bogus check_for_ciph_cmd() copy 2016-02-15 14:28:19 +01:00
Harald Welte
e634fd256b LC15: set nominal transmit power of 37dBm for all TRX 2016-02-15 14:28:05 +01:00
Harald Welte
433863e4c9 LC15: Fix 'make dist' (missing include files) 2016-02-15 14:28:00 +01:00
Harald Welte
634c3e4648 Use consistent naming of binaries accross BTS models
Let's use one systematic naming schemes for all BTS models.

osmobts-trx -> osmo-bts-trx
sysmobts -> osmo-bts-sysmo
lc15bts -> osmo-bts-lc15
2016-02-15 14:27:57 +01:00
Harald Welte
a9a7120c82 make PCU socket and telnet port configurable
In some cases we'd like to run multiple instances of osmo-bts on a
single machine.  This is the case where we a multi-TRX PHY is to be used
for several BTSs, or in case osmo-bts-trx has multple SDRs attached.

This wa currently prevented by having a hard-coded PCU socket path
and telnet port, which are now configurable via VTY / config file
itself.
2016-02-15 14:27:52 +01:00
Harald Welte
5dfb115eaf declare pcu_direct in pcu_if.h 2016-02-15 14:27:47 +01:00
Harald Welte
c6723c8206 move auto-band configuration commands to common/vty.c
It remains up to the individual BTS hardware models to decide
whether or not to register those commands (depending on whether they
support the feature) via cfg_bts_auto_band_cmd / cfg_bts_no_auto_band_cmd
2016-02-15 14:27:43 +01:00
Harald Welte
3b4d9e7c07 LC15: Call l1if_reset() after l1if_open()
We want to start talking to the L1 from the point the PHY link has
been opened, and not only once an OML connection has been established.
2016-02-15 14:27:36 +01:00
Harald Welte
53e0291df6 LC15: Remove clk_cal (another unused struct member) 2016-02-15 14:27:32 +01:00
Harald Welte
e9a17292e8 LC15/sysmobts: Don't try to refer to fl1h from PHY config
At the time the phy link / phy instance level VTY configuration
commands are parsed, we did not yet call l1if_open() and thus
pinst->u.{lc15,sysmobts}.hdl == NULL.

PHY or PHY instance specific configuration must thus be stored inside
the phy_link or phy_instance itself, and not inside the (not yet
existing) handle.

We solve this by moving around some parameters:
* clk_use_eeprom/clk_cal/clk_src/calib_path get replicated in
  phy_instance
* min_qual_{rach,norm} are moved into the generic part (which means
  that osmo-bts-octphy and osmo-bts-trx should also implement them)
2016-02-15 14:27:29 +01:00
Harald Welte
9b5cff87ec LC15: Remove unused clk_use_eeprom and clk_src fields
this is part of the copy+paste legacy from sysmobts and can be removed
as it is not used.
2016-02-15 14:27:25 +01:00
Harald Welte
9684099ae9 sysmobts/LC15: Fix startup-time DSP trace flage configuration
Due to the changes introduced by the phy_link API, it's not easy to set
the default DSP trace flags via a command line argument anymore.  We now
rather introduce a persitent VTY configuration command, by which the
default DSP tracing configuration can be set (for each PHY).

The persistent trace flags are stored in the phy_instance, while the
current operational run-time flags are in fl1h->phy_instance.
2016-02-15 14:27:20 +01:00
Harald Welte
38933afdd9 introduce + use new generic vty_get_phy_instance()
this function is intended to be used by VTY commands that need to
resolve a given PHY interface.
2016-02-15 14:27:16 +01:00
Harald Welte
6a0f0f9e21 LC15: fix compiler warning against more recent libosmovty 2016-02-15 14:27:12 +01:00
Harald Welte
4dd8bd84a4 LC15: Fix printed msgq file names in error messages 2016-02-15 14:27:08 +01:00
Harald Welte
8f0266b885 LC15: cosmetic whitespace fixes 2016-02-15 14:27:04 +01:00
Harald Welte
234309878e LC15: Add example configuration file for Litecell 1.5 2016-02-15 14:26:58 +01:00
Harald Welte
1dcb97eaa3 LC15: port litecell 1.5 support to recent osmo-bts master
This includes changes required for
* shared main() function accross all BTS models
* use of the new phy_link / phy_instance infrastructure as the basis
  for true multi-TRX operation
2016-02-15 14:26:55 +01:00
Harald Welte
29a0197ead LC15: configure.ac: Allow specifying an alternate include-dir
The user can now use ./configure --with-litecell15=/my/local/path
2016-02-15 14:26:51 +01:00
Harald Welte
ccc7a1bf46 LC15: configure.ac: use --enable-litecell15 insteda of --enable-litecell15-bts 2016-02-15 14:26:47 +01:00
Yves Godin
b936bd7162 LC15: use talloc pool for msgb and ortp library
by using a talloc pool, we avoid having to go back to the libc
malloc pool all the time.  The msgb allocations and libortp allocations
happen quite frequently during processing and show up as one of the
high priority items in osmo-bts profiles on sysmoBTS with 14 concurrent
TCH/H calls (highest load scenario).

talloc still consumes significant CPU, this is mostly due to the
zero-initialization of all the associated buffers.  Strictly speaking
we shouldn't need this, but any change there would require lots of
testing, as there might be hidden assumptions in the code?

In some percentage of cases, talloc still seems to fall back on malloc
for msgb allocations, which is currently a bit of a mystery.  The pools
certainly are large enough, talloc_reprt() rarely reports more than a
few tens of kilobytes used by the msgb pool.

From 2ecbf87130
2016-02-15 14:26:44 +01:00
Yves Godin
6e1aed4b23 LC15: Disable DSP trace flags by default 2016-02-15 14:26:38 +01:00
Yves Godin
2a711887b7 LC15: Add initial support for the NuRAN Wireless Litecell 1.5
This commit adds basic support for the Litecell 1.5. Multi-TRX is not
supported yet. Instead, multiple instances of the BTS can be launched
using command line parameter -n <HW_TRX_NR> to specify if TRX 1 or
2 must be used by the bts. Note that only TRX 1 opens a connection to
the PCU. Full support for GPRS on both TRX will come at the same time
than the multi-TRX support.

The BTS manager has been adapted to match the new hardware but otherwise
it has not been improved or changed compared to the one used on the
SuperFemto/Litecell (sysmobts).
2016-02-15 14:26:33 +01:00
Harald Welte
5a945dad0c sysmobts: make clock calibration eeprom default (again?) 2016-02-15 14:23:57 +01:00
Harald Welte
b1d2dd316f abis.c: Fix segfault on OML link loss
When the OML signalling link is lost, first set bts->oml_link = NULL,
then iterate over the RSL links and close them.  Closing the RSL link
will cause a OML state change message to be sent, which in turn tries
to use the no-longer-existing OML link.

The code should be cleaned up further to distinguish which signalling
link was lost, and actually communicate a RSL(only) loss to OML.

But for now, it's best to simply close down all links and terminate
osmo-bts to ensure all state is properly reset and recovered.
2016-02-15 14:23:18 +01:00
Harald Welte
f5b42c3421 Merge branch 'laforge/phy-link'
this introduces the new phy_link / phy_instance interface, which is the
basis of clean support for all kinds of multi-trx configurations with
various BTS modules.

WARNING: This breaks configuration file compatibility.  You will need to
introduce config nodes for 'phy' and 'instance', as well as the link
from the 'trx' nodes towards the phy instance.
2016-02-15 14:19:46 +01:00
Harald Welte
a02bf125ac port sysmobts to phy_link/phy_instance abstraction 2016-02-15 14:18:59 +01:00
Harald Welte
fcef6b2b52 don't touch OML MO when PHY link is established
It seems the right thing to do: Once we know a PHY link is established,
the associated OML managed objects should change their state
accordingly.  However, given all the hackery we do with MO states, this
actually breaks things, rather than helping.  So I'm disabling that part
for now, but this needs to be re-visited at some point.
2016-02-15 14:18:59 +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
f58542899a Merge branch 'laforge/trx-split'
This splits the TRX scheduler into a generic part and an osmo-bts-trx
specific part.  It is the basis for re-using the scheduler from other
bts modules such as the upcoming osmo-bts-virtual.
2016-02-15 14:18:06 +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
Harald Welte
48726242ad TRX: scheduler: Remove dependency to trx_if.[ch] 2016-02-15 14:17:55 +01:00
Harald Welte
67311cc1f2 TRX: scheduler: Move trx_sched_clock() to scheduler_trx.c
This funciton (and associated static functions) are TRX specific,
and scheduler.c should only contain generic code.
2016-02-15 14:17:55 +01:00
Harald Welte
b6b42d150d TRX: scheduler: don't access l1h->config from scheduler 2016-02-15 14:17:55 +01:00
Harald Welte
11db925f15 TRX: call trx_loop_sacch_clock from TRX scheduler backend
this removes the dependency of scheduler.c on loops.h
2016-02-15 14:17:55 +01:00
Harald Welte
2b0e209029 TRX: split scheduler in generic part and backend part
the backend is performing the actual encoding and decoding functions,
while the generic part constsits of the TDMA structures and generating
the RTS.ind
2016-02-15 14:17:55 +01:00
Harald Welte
5538f5cff8 TRX: factor out the scheduler from remaining code
The L1 scheduler is a generally useful component that is unfortunately
tied quite a bit into the OsmoTRX support.  Let's try to separate it out
by having separate per-trx/per-ts/per-chan data structures pre-fixed
with l1sched_

Using this patch it should be one step easier to use the scheduler for
other BTS models, such as the intended upcoming virtual BTS.
2016-02-15 14:17:55 +01:00
Harald Welte
5f17720fcd fix migration of check_for_ciph_cmd() from sysmobts to l1sap
During the L1SAP related changes, somehow an old version of
check_for_ciph_cmd() was re-introduced, which didn't store the N(s) as
part of the lchan.  To make things worse, the old code was still present
in the sysmobts specific part, but never executed.
2016-02-09 13:59:55 +01:00
Harald Welte
5d212055b7 L1SAP: Ensure we don't process MPH-TIME.indication on TRX != C0 2016-02-03 18:45:39 +01:00
Harald Welte
6f9beedc48 fix compile warnings 2016-02-03 18:45:39 +01:00
Harald Welte
131ab36e3a abis: Add a queue of OML messages
When the oml_link is down or not yet established, we currently lost
any OML messages that were scheduled for transmission to the BSC.  Let's
prevent that by keeping a queue of OML messages, which is drained at the
time the OML link comes up again.
2016-02-03 18:45:39 +01:00
Harald Welte
2ed116efec Revert "oml: temporary debug hack"
This reverts commit c623c4e589.

That's a commit from 2012, and it was never needed ever since.
2016-02-03 18:45:39 +01:00
Holger Hans Peter Freyther
5f8c85bf9c octphy: Look-up the right timeslot and then the logical chan
Use the right identifier for the timeslot and not the trx number
which would always use ts==0 on the first trx. This should fix
ciphering issues for TS>0 (e.g. SDCCH8 on TS==1)
2016-02-03 18:29:00 +01:00
Harald Welte
3ca59512d2 OML: Ignore T200 settings by BSC for now
It seems that once we start to respect the T200 values as specified by
the BSC, we run into all kinds of issues with LAPDm re-transmissions,
REJ frames, unexpected supervisory frames and the like.

The libosmogsm LAPDm T200 defaults of 1s/2s are proven to "work" (i.e.
not expose the above behavior), so let's revert to them until the root
cause of this problem is determined.
2016-01-25 20:46:56 +01:00
Harald Welte
111a02f214 lapdm: Add DEBUGP statement about T200 values being set for lchan 2016-01-25 20:46:53 +01:00
Harald Welte
0d19e48487 Fix T200 default values
The T200 default values should be in milli-seconds (as the variable name
indicates).  They are not expected to be divided by the TS 12.21 OML
dividers for T200.

This change doesn't really make a difference with OpenBSC, as the BSC
always sets its own T200 values via OML, overwriting the defaults here.
2016-01-25 20:46:51 +01:00
Holger Hans Peter Freyther
728448a7f1 main: Return something from the method
Fixes: CID#59923
2016-01-23 10:25:24 +01:00
Harald Welte
0db18d030d OCTPHY: fix 'make dist' (missing header files) 2016-01-22 09:44:17 +01:00
Harald Welte
0048a788dd Merge branch 'laforge/common-main' 2016-01-22 09:33:54 +01:00
Harald Welte
611ef23700 merge bts-specific main function into common/main.c:bts_main()
This removes a lot of copy+paste duplication between different BTS
models.
2016-01-22 09:09:09 +01:00
Harald Welte
a0192b859b Add new bts_model_ctrl_cmds_install()
This is one step in making the main() functions of different
BTS models more similar, so we can share one code rather than multiple
copies of it.
2016-01-22 09:09:09 +01:00
Harald Welte
ec3be11ec6 common/support.c: Remove unused file 2016-01-22 09:09:08 +01:00
Andreas Eversberg
69fc57b028 ABIS: Support for multiple RSL connections 2016-01-22 09:09:02 +01:00
Harald Welte
32d681ab98 OCTPHY: Don't have files in EXTRA_DIST that don't exist (anymore)
This fixes a 'make dist' issue.
2016-01-21 16:32:14 +01:00
Harald Welte
e60b9d1de6 Make T200 default initialization even more robust
There's no need to use memcpy(), which adds the risk that the types of
source and destination are not the same (see previous commit). Iterating
over the array and assigning each element is more robust.
2016-01-17 21:10:13 +01:00
Harald Welte
3d431bb4eb Fix T200 default values
t200_ms is an unsigned int [7] array, while the oml_default_t200_ms was
an uint8_t[7] array, which we memcpy() to the former as default
initializer.  Fix this by turning oml_default_t200_ms into unsigned int,
too.
2016-01-17 21:10:09 +01:00
Harald Welte
5e8d8a1e75 Merge branch 'laforge/cleanup' 2016-01-16 17:51:16 +01:00
Harald Welte
f9de18ea15 TRX: the L1SAP queue contains mac blocks, not bursts (cosmetic) 2016-01-16 17:49:13 +01:00
Harald Welte
97cb71971a TRX: Don't hard-code 23 bytes, use GSM_MACBLOCK_LEN 2016-01-16 17:49:08 +01:00
Harald Welte
dd562d84ba TRX: Don't use magic numbers when we have #defines 2016-01-16 17:49:04 +01:00
Harald Welte
773ab8b2c5 TRX: replace some more 2715648 magic numbers with GSM_HYPERFRAME 2016-01-16 17:48:57 +01:00
Harald Welte
69ace680dd TRX: scheduler: whitespace cleanup 2016-01-16 17:48:53 +01:00
Harald Welte
1bdd08d07d TRX: schedule: remove dead code
the check whether or not to send a dummy burst is done already in
trx_sched_dl_burst(), so no need to have commented-out code doing that
again.
2016-01-16 17:48:45 +01:00
Harald Welte
519a639cf3 TRX: make trx_chan_desc static, it is not used externally 2016-01-16 17:48:40 +01:00
Harald Welte
6323d2e617 use existing #define for FR/EFR frame length (33/31) 2016-01-16 17:48:26 +01:00
Harald Welte
601781f463 move 'GSM_FR_BYTES' and related definitiions to common part 2016-01-16 17:48:20 +01:00
Harald Welte
695d8eb277 TRX: Reduce magic numbers, introduce GSM_HYPERFRAME for 2715648 2016-01-16 17:48:15 +01:00
Harald Welte
5b500f5d8f TRX: use const for dummy and fcch burst definitions 2016-01-16 17:48:04 +01:00
Harald Welte
2bf00d7729 TRX: mark scheduler data structures as 'const'
Those are read-only tables which should end up in the text segment
and not in writable data.
2016-01-16 17:47:59 +01:00
Harald Welte
12992d86dc TRX: some comments dscribing the scheduler.[ch] API 2016-01-16 17:47:54 +01:00
Harald Welte
d93bd21185 sysmoBTS: port 'press Ctrl+C twice for immediate exit' from osmo-bts-trx 2016-01-16 17:47:40 +01:00
Harald Welte
8250800d3b TRX: Add stub bts_model_change_power() function
This just fixes linking. It still needs to be properly implemented
2016-01-16 17:47:34 +01:00
Harald Welte
6d101a79a8 TRX: remove obsolete get_mac() function 2016-01-16 17:47:13 +01:00
Harald Welte
20e8770df0 Merge branch 'sysmocom/octphy' 2016-01-16 17:28:25 +01:00
Harald Welte
866f9b979d OCTPHY: Obtain information from PHY and expose it in VTY
This adds 'show trx 0 system-information' command to the VTY indicating
various version information obtained from the DSP/PHY.
2016-01-16 17:26:26 +01:00
Harald Welte
3e98f942e5 OCTPHY: Implement command re-transmission after message loss
We re-use the 'wait_l1_conf' structure for implementing the
unacknowledge command window towards the PHY.  This means that thre will
unconditionally be a 'wait_l1_conf' now, even for requests where the
caller didn't provide a call-back.
2016-01-16 17:26:25 +01:00
Harald Welte
7bd2251dcb OCTPHY: Print NOTICE message if we receive supervisory frame 2016-01-16 17:26:24 +01:00
Harald Welte
0c017618cd OCTPHY: Block PHY indications until it is confirmed open
When re-starting OsmoBTS after unclean shutdown, the PHY is already
sending notifications (PH-DATA.ind, PH-TIME.ind, etc.) for the previous
physical channel / timeslot configuration.  At the point those messages
are received, OsmoBTS might not even have A-bis OML up yet, and thus has
no clue how to process such messages (and subsequently likely crashes).

Let's block such primitives from passing further up the code until we
have received the TRX-OPEN response.
2016-01-16 17:26:22 +01:00
Harald Welte
8d198f3598 OCTPHY: Fix various memory leaks and add comments on msgb ownership 2016-01-16 17:26:21 +01:00
Harald Welte
bca8d3b8f8 OCTPHY: Exit gracefully if config file specifies no phy-netdev 2016-01-16 17:26:20 +01:00
Harald Welte
a9003acb1c OCTPHY: Ensure we write the phy-netdev parameter
When writing the config file from the command line, we must not forget
to write the phy-netdev parameter, otherwise the program will fail to
re-start later :/
2016-01-16 17:26:19 +01:00
Harald Welte
dad89e50a2 OCTPHY: Replace '-lortp' with the proper pkg-config/autofoo version 2016-01-16 17:26:06 +01:00
Harald Welte
b92100ad36 Add support for Octasic OCTSDR-2G GSM PHY
This adds support for a new PHY to OsmoBTS, the Octasic OCTSDR-2G
PHY. This is a proprietary GSM PHY running on a familty of Octasic DSPs.
2016-01-16 17:23:10 +01:00
Harald Welte
e9f12acbeb LAPDm: Use T200 settings from OML rather than libosmocore defaults 2016-01-16 16:25:52 +01:00
Harald Welte
7d6860b114 print a NOTICE message if lchan not activ in get_active_lchan_by_chan_nr() 2016-01-16 16:25:52 +01:00
Alexander Huemer
056c267b89 fix some format specifiers 2016-01-15 15:33:46 +01:00
Holger Hans Peter Freyther
2b7728cd9d sysmobts-calib: Warn about firmware and header mismatch
sysmobts-calib might be easily patched by a user that does not know
that firmware and firmware headers form a contract that should be
matched. Compare the version numbers and print a warning if it does
not look correct. This should be enough for a user to see that something
is not right. Continue anyway as the firmware might still be compatible
(because the ABI has not changed).

Fixes: SYS#1172
2016-01-11 20:47:36 +01:00
Holger Hans Peter Freyther
65b4a7ba2b sysmobts-v2/eepromreader: Add userspace program to read EEPROM
If using a too old kernel on newer devices the eeprom reading will
fail and maybe it is not possible to update the kernel after the
unit has been deployed.

Add a utility to read the EEPROM of revD+ from userspace to be used
to fix up the thing.
2016-01-11 17:29:24 +01:00
Harald Welte
74269054a6 sysmobts: add missing break statement in l1if_handle_ind()
this was introduced in 21b020b336 and
luckily spotted by coverity (CID 1347446)
2016-01-08 14:19:23 +01:00
Alexander Chemeris
a62e3221b6 l1sap: Whitespace fixes. 2016-01-08 13:07:14 +01:00
Harald Welte
085569df55 fix large amount of compiler warnings in common and sysmobts code 2016-01-04 20:29:24 +01:00
Harald Welte
21b020b336 sysmobts: Clarify msgb ownership / fix memory leaks 2016-01-04 20:17:32 +01:00
Holger Hans Peter Freyther
e28a20a2d9 sysmobts: Catch up with the API changes and specify the version
API revision 5.1 allows us to pass a version number for the rx/tx
calibration and the DSP/FPGA will inform us about clock errors.
2015-12-07 11:23:36 +01:00
Minh-Quang Nguyen
2da932c7a0 sysmobts: support eeprom map version 2
[hfreyther: Accept the mixing of whitespace to ease future
merges]
2015-12-07 11:10:57 +01:00
Harald Welte
2ecbf87130 use talloc pool for msgb and ortp library
by using a talloc pool, we avoid having to go back to the libc
malloc pool all the time.  The msgb allocations and libortp allocations
happen quite frequently during processing and show up as one of the
high priority items in osmo-bts profiles on sysmoBTS with 14 concurrent
TCH/H calls (highest load scenario).

talloc still consumes significant CPU, this is mostly due to the
zero-initialization of all the associated buffers.  Strictly speaking
we shouldn't need this, but any change there would require lots of
testing, as there might be hidden assumptions in the code?

In some percentage of cases, talloc still seems to fall back on malloc
for msgb allocations, which is currently a bit of a mystery.  The pools
certainly are large enough, talloc_reprt() rarely reports more than a
few tens of kilobytes used by the msgb pool.
2015-12-06 21:31:39 +01:00
Harald Welte
62d7502b82 osmo-bts-sysmo: Disable DSP trace flags by default 2015-12-05 15:57:09 +01:00
Harald Welte
2d5481da27 l1sap: Ensure we only pass PHY primitives of active lchans
In some situations, a PHY might send us a primitive for a logical
channel that is not (or no longer) active.  Passing such primitives
higher up the stack is asking for trouble.  Specifically, LAPDm
instances cannot accept messages once their instance has been released.

We introduce two new helper functions: get_lchan_by_chan_nr() as well as
get_active_lchan_by_chan_nr().  The former just centralizes the look-up
of the lchan by timeslot number and sub-slot number.  The latter also
checks to ensure the lchan is active, which is used for PH-DATA / PH-RTS
primitives.  To the contrary, MPH primitives generally don't require the
cahnnel to be active for processing.
2015-12-05 11:54:08 +01:00
Harald Welte
44bc9408b1 common/rsl.c: The presence of a valied measurement result is DEBUG
we shouldn't consider the presence of a valid measurement result
as something NOTICEable
2015-12-03 19:54:38 +01:00
Harald Welte
02337e1d1d sysmobts: Dont recycle PHY primitive for L1SAP in PH-DATA.ind 2015-11-20 21:35:07 +01:00
Harald Welte
437deb5f3a sysmobts: fix ph_data_req() msgb handling + alignment
The way we recycle the msgb with a l1sap header when transforming a
PH-DATA.req L1SAP primitive into a PHY/L1 primitive was flawed in
several ways:

1) the way the L1SAP header was stored in the buffer didn't provide
   sufficient tailroom for the L1 primitive
2) the alignment of the data in L1SAP is at a 32bit bounadry, but not
   in the L1 primitive, causing unaligned accesses.
2015-11-20 18:05:51 +01:00
Harald Welte
48e99fd05a cope with 'struct gsm_bts' without a tsc member
This was introduced in openbsc.git a2bbc5ec0e6481bb5b65da7bdbde03a424437af4
2015-11-20 10:54:09 +01:00
Harald Welte
3c161bb7df tests/Makefile.am: Don't use sysmobts SUBDIRS twice
probably a git merge artefact of some sort...
2015-11-05 23:05:20 +01:00
Harald Welte
bbcf703be8 TRX: catch up with trhe amr_mode naming changes
OpenBSC introduced a naming change in
615ed46a6ab25f71a7ab0d8201d33b4dbf8fc5b0 but osmo-bts fixes were only
about osmo-bts-sysmo, not osmo-bts-trx.  This updates osmo-bts-trx
accordingly.
2015-11-05 23:02:55 +01:00
Harald Welte
94da045be5 Don't blindly link against '-lortp' but use pkg-config for that
This also ensures that a missing ortp library dependency is discovered
at configure time already
2015-11-05 22:52:50 +01:00
Harald Welte
33f234f278 Revert "configure.ac: Add subdir-objects to suppress warnings"
This reverts commit 94a05abb98.

The tests don't work well with subdir-objects, so we have to live with
the warnings meanwhile until somebody finds time to find the magic spell
to solve the autotools quest.
2015-11-05 22:48:24 +01:00
Harald Welte
55d89d17b2 configure.ac: Better description for --enable-sysmocom-bts and --enable-trx 2015-10-12 12:15:49 +02:00
Harald Welte
94a05abb98 configure.ac: Add subdir-objects to suppress warnings
automake: warning: possible forward-incompatibility.
automake: At least a source file is in a subdirectory, but the 'subdir-objects'
automake: automake option hasn't been enabled.  For now, the corresponding output
automake: object file(s) will be placed in the top-level directory.  However,
automake: this behaviour will change in future Automake versions: they will
automake: unconditionally cause object files to be placed in the same subdirectory
automake: of the corresponding sources.
automake: You are advised to start using 'subdir-objects' option throughout your
automake: project, to avoid future incompatibilities.
2015-10-12 12:13:13 +02:00
Harald Welte
45e597cc16 configure.ac: Depend on libosmotrau 0.3.2 (ortp statistics) 2015-10-12 12:12:29 +02:00
Harald Welte
9a9ddc1203 configure.ac: Only require libgps if building for sysmoBTS 2015-10-12 12:12:22 +02:00
Holger Hans Peter Freyther
13947b3408 amr: Catch-up for the non-RTP mode after amr rename 2015-10-03 22:45:52 +02:00
Holger Hans Peter Freyther
1009a87f3c amr: Catch up with the amr_mode changes
Use the bts_modes for all the types. As there are two instances
know. One for the ms and one for the bts.

Manual compile fix and not tested on HW
2015-10-03 22:34:37 +02:00
Harald Welte
f1fb0fa3af Merge branch '201509-trx-rebase' 2015-09-22 16:41:54 +02:00
Harald Welte
caa648d92e TRX: Add missing call to abis_init()
This somehow got lost during the latest rebase.
2015-09-22 16:41:32 +02:00
Harald Welte
88a31e2a99 make osmo-bts-trx provide bts_model_adjst_ms_pwr() 2015-09-22 16:41:32 +02:00
Harald Welte
307bfc81c1 fixup tests after bts_model_adjst_ms_pwr 2015-09-22 16:41:32 +02:00
Alexander Chemeris
5becc4613a tests: Update busrsts_test build.
We've added logging calls to the bursts processing. Add logging facility
initializatoin to the test code.
2015-09-22 16:41:31 +02:00
Alexander Chemeris
b812839dfa trx: fix potential use of uninitialized toa variable.
Not really a bug, as we're smart about it down the stream, but it's better to
be strict here as well.
2015-09-22 16:41:31 +02:00
Alexander Chemeris
ae525a8761 trx: Send POWERON/OFF commands to osmo-bts only for the first channel.
osmo-trx never supported separate power control for trx's, but now it started
to be more strict about it.
2015-09-22 16:41:31 +02:00
Alexander Chemeris
29ea40f538 trx: Assume 100% BER if total decoded bits is 0 in l1if_process_meas_res() 2015-09-22 16:41:31 +02:00
Alexander Chemeris
e9abc5a4f3 trx: Cleanup unused parts of loops.c 2015-09-22 16:41:31 +02:00
Alexander Chemeris
17be7fa73b trx: Remove unused variables. 2015-09-22 16:41:31 +02:00
Alexander Chemeris
68e8b2b1d5 trx: Fix typo in a log message. 2015-09-22 16:41:31 +02:00
Alexander Chemeris
391ff14977 trx: More logging for voice frame decoding functions. 2015-09-22 16:41:31 +02:00
Alexander Chemeris
cf18dcd5fd tests: Update bursts_test to accommodate BER calculations. 2015-09-22 16:41:31 +02:00
Alexander Chemeris
6fceaca584 trx: Implement BER calculations.
A known issue with this code is that BER is not updated for lost TCH frames,
because osmo-trx doesn't send any indication for them and we don't have
a callback to handle this.

Otherwise the code seem to work fine.
2015-09-22 16:41:31 +02:00
Thomas Tsou
ddc0bf14d5 TRX: Remove extra TCH/HS puncturing value
3GPP TS 05.03 "Channel coding" specifies the puncturing matrix (1,0,1)
for class 1 information bits and tail bits valued u(0) to u(103) for a
maximum puncturing index of 311. The puncturing index 313 exceeds the
maximum index and causes osmo_conv_get_output_length() to output the
improper length of 210 instead of 211.

Signed-off-by: Thomas Tsou <tom@tsou.cc>
2015-09-22 16:41:31 +02:00
Andreas Eversberg
deb01a2652 TRX: Check if Transceiver indicates an out of range clock
If frame number is out of range (>= 2715648), the scheduler's process
would end up in an infinite loop. This is because the loop would schedule
bursts until the indicated frame number is reached, which would not be
possible.

The openbts, calypso-bts and osmo-trx might send out out of range clock
indications every 3.5 hour.
2015-09-22 16:41:30 +02:00
Andreas Eversberg
3cfc9d5fa3 TRX: Show which TRX does not respond or rejects a command 2015-09-22 16:41:30 +02:00
Andreas Eversberg
a7d0c5ef5a trx: Set lchan inactive, only if the dedicated channel is deactivated 2015-09-22 16:41:30 +02:00
Andreas Eversberg
f39c739bd6 TRX: Activate LCHAN of CCCH when CCCH is configured on time slot 2015-09-22 16:41:30 +02:00
Andreas Eversberg
f66f5b3ddc TRX: Free bust buffer memory to when changing lchan type 2015-09-22 16:41:30 +02:00
Andreas Eversberg
c241afa87c TRX: Add VTY option to allow setting RTS advance in frames
RTS (ready-to-send) must be issued in advance, so BTS core and especially
osmo-pcu can provide downlink data frames early enough. In some cases PCU
might provide frames too late, so they must be dropped. If PCU provides
frames too late, due to high system load, this "RTS advance" setting must
be increased.
2015-09-22 16:41:30 +02:00
Martin Hauke
178d618d5a TRX: fix some typos in comments 2015-09-22 16:41:30 +02:00
Martin Hauke
c9ddb2ba22 build: Use AM_CPPFLAGS in Makefile.am
Since automake 1.13 INCLUDES is depricated and causes a warning
Inspired from similar patches by Alexander Huemer for other osmocom
projects.
2015-09-22 16:41:30 +02:00
Martin Hauke
73d3f46994 tests: make tests for sysmobts conditional 2015-09-22 16:41:30 +02:00
Andreas Eversberg
b2482a8574 Allow TRX 0..254 at VTY, even if less TRX are available
Instead of limiting the number of TRX at VTY to the actual number of
supported TRX, VTY allows to configure any possible number of TRX. If a
TRX is configured, which is not supported by BTS model, an error message is
returned, which states that the given TRX is not supported.
2015-09-22 16:41:30 +02:00
Andreas Eversberg
812fdd92c7 TRX: Changed logging of unserved primitives from LOGL_NOTICE to LOGL_INFO 2015-09-22 16:41:30 +02:00
Andreas Eversberg
ec6225e3e0 TRX: Fixed chan_nr for SACCH/8(7) at scheduler 2015-09-22 16:41:29 +02:00
Andreas Eversberg
ef6eb5442c trx: Add option to set transmit power reduction via OML (BSC) 2015-09-22 16:41:29 +02:00
Andreas Eversberg
f0072a8de8 TRX: Do not send burst on IDLE channels at TRX != C0
This is required, so the transceiver transmits no power.
2015-09-22 16:41:29 +02:00
Andreas Eversberg
3cf28aa924 TRX: Close TRX (shutdown all active channels) on ABIS link failure 2015-09-22 16:41:29 +02:00
Andreas Eversberg
578340c7a7 TRX: Add bts_model_trx_close to TRX implementation 2015-09-22 16:41:29 +02:00
Andreas Eversberg
3caf3b7c45 TRX: Fixup ciphering state names after rebasing 2015-09-22 16:41:29 +02:00
Andreas Eversberg
ee47913389 TRX: No need to set mode and cipher for PDCH 2015-09-22 16:41:29 +02:00
Andreas Eversberg
f5aaf523c5 TRX: If no cipher algorithm is given, or if it is a5/0, reset cipher state 2015-09-22 16:41:29 +02:00
Andreas Eversberg
8c8998e551 TRX: Set ciphering to an initial state when activating channel
Handover and assignment may activate channels with ciphering already set,
so we need to tell scheduler to enable/disable ciphering and set the
correct cipher state.
2015-09-22 16:41:29 +02:00
Andreas Eversberg
da0c44a9db Add test case for successful handover and unsuccessful handover 2015-09-22 16:41:29 +02:00
Andreas Eversberg
798c1bba9d TRX: Process real time scheduling option is now similar to sysmobts 2015-09-22 16:41:29 +02:00
Andreas Eversberg
db0b93ac39 TRX: Disable handover burst detection when closing channel during detection 2015-09-22 16:41:29 +02:00
Andreas Eversberg
86c936cbb1 TRX: Use correct slot type for GSM_PHCAN_BCCH 2015-09-22 16:41:28 +02:00
Andreas Eversberg
b9a917a138 TRX: Handover access burst support 2015-09-22 16:41:28 +02:00
Andreas Eversberg
6527dffc94 TRX: Clear lchan state when resetting TRX 2015-09-22 16:41:28 +02:00
Andreas Eversberg
fb04746bce TRX: Report measurements 2015-09-22 16:41:28 +02:00
Andreas Eversberg
05597a7ddb TRX: Fixed typos tranceiver -> transceiver 2015-09-22 16:41:28 +02:00
Andreas Eversberg
82676c13ee TRX: Fix: Cleanly free TRX instances during initialization in case of an error 2015-09-22 16:41:28 +02:00
Andreas Eversberg
c2ee307fd4 Allow one or more TRX to configure via VTY 2015-09-22 16:41:28 +02:00
Andreas Eversberg
2e4a26a0e9 TRX: Add VTY options to enable and disable SETTSC and SETBSIC 2015-09-22 16:41:28 +02:00
Andreas Eversberg
6508f21130 TRX: Reset ciphering state when closing channel 2015-09-22 16:41:28 +02:00
Andreas Eversberg
c5241c3aa4 TRX: Support for AMR half speech 2015-09-22 16:41:28 +02:00
Andreas Eversberg
c910a332b2 TRX: Support for TCH/H and GSM half rate transcoding 2015-09-22 16:41:27 +02:00
Andreas Eversberg
f62a64e440 TRX: Add AMR Payload handling 2015-09-22 16:41:27 +02:00
Andreas Eversberg
a7f5e07712 TRX: Support for AMR full speech 2015-09-22 16:41:27 +02:00
Andreas Eversberg
5e2341411f Get RSSI from received uplink data and send to PCU 2015-09-22 16:41:27 +02:00
Andreas Eversberg
917cf7018b TRX: Add support for EFR transcoding 2015-09-22 16:41:27 +02:00
Andreas Eversberg
84b9a44535 TRX: Code cleanup, prepare for other codecs than GSM full rate 2015-09-22 16:41:27 +02:00
Andreas Eversberg
7ff22823ca TRX: Use link timeout value from BSC via OML attribute. 2015-09-22 16:41:27 +02:00
Andreas Eversberg
9855e8bd48 TRX: Out of range primitives found in downlink queue are not an error 2015-09-22 16:41:27 +02:00
Andreas Eversberg
219ece83a3 TRX: Implementation of MS power and timing advance loops 2015-09-22 16:41:27 +02:00
Andreas Eversberg
889890da43 TRX: Improved handling of clock indications.
If no clock is received, a POWEROFF is sent until clock is detected.
2015-09-22 16:41:27 +02:00
Andreas Eversberg
23a5183767 TRX: Fixes to TRX interface
Ignore false response to uncritical commands.
2015-09-22 16:41:27 +02:00
Andreas Eversberg
ce0f20b597 TRX: Fix of SCH burst data 2015-09-22 16:41:26 +02:00
Andreas Eversberg
7bd6e8b89b TRX: Ciphering 2015-09-22 16:41:26 +02:00
Andreas Eversberg
d692b6e054 TRX: Replaced GSM 06.10 ordering table by table in libosmocodec 2015-09-22 16:41:26 +02:00
Andreas Eversberg
89e36c0e64 TRX: Cleanup of channel transcoding 2015-09-22 16:41:26 +02:00
Andreas Eversberg
801c182c02 TRX: By default, send 20 frames in advance to tranceiver 2015-09-22 16:41:26 +02:00
Andreas Eversberg
7451ce29a7 TRX: Detect missing received bursts and fill them with zero-sbits 2015-09-22 16:41:26 +02:00
Andreas Eversberg
450d32919a TRX: Add test code for PDTCH transcoding 2015-09-22 16:41:26 +02:00
Andreas Eversberg
78b2080027 TRX: PDTCH (GPRS) works now
Detection and transcoding of all four coding schemes are supported.
2015-09-22 16:41:26 +02:00
Andreas Eversberg
9de67ca962 TRX: Lost TCH frame detection of omitted bursts from tranceiver 2015-09-22 16:41:26 +02:00
Andreas Eversberg
b9880bc812 TRX: Allow transcoding of TCH FR with MSB first (RTP) or LSB first (E1) 2015-09-22 16:41:26 +02:00
Andreas Eversberg
d10eaee4cc TRX: Completed TCH/F full rate support
Full rate is now tested and working.
2015-09-22 16:41:25 +02:00
Andreas Eversberg
b104aed5ec TRX: Fixed swapped stealing bits
Thanx to Sylvain for pointing to this bug.
2015-09-22 16:41:25 +02:00
Andreas Eversberg
cd463dd72a TRX: Minor fixes, especially handle TOA of RACH correctly 2015-09-22 16:41:25 +02:00
Andreas Eversberg
7d684d6866 TRX: Fix, never send confirm for DEACT SACCH request (TS 05.08 4.6)
Sending it would cause BSC to change to a state, where it does not release
rf channel.
2015-09-22 16:41:25 +02:00
Andreas Eversberg
e0959e7929 TRX: Use received TRX clocks to determine availablility of tranceiver
Only if transceiver becomes available, control commands are sent. If
tranceiver is gone, reset scheduler.

The current availability state is sent to BSC via OML state change
commands.
2015-09-22 16:41:25 +02:00
Andreas Eversberg
2ea68e2b7b TRX: Fixes and improvements of scheduler 2015-09-22 16:41:25 +02:00
Andreas Eversberg
2c8787224f Fix: Check right result on bursts_test 2015-09-22 16:41:25 +02:00
Andreas Eversberg
74d63b7212 Add test routing to test transcoding of TCH FR / FACCH frames 2015-09-22 16:41:25 +02:00
Andreas Eversberg
d0603d96e9 TRX: Completed transcoding of TCH with reordering Table 2 of TS 05.03 2015-09-22 16:41:25 +02:00
Andreas Eversberg
414faaca19 TRX: Power down tranceiver and reset scheduler, if abis link is lost
If BTS is gone, TRX is powered down, due to loss of abis link. If link is
esablished again, tranceiver and scheduler are provisioned again by BTS.
2015-09-22 16:41:25 +02:00
Andreas Eversberg
7a0d11dd68 ABIS: Introduce bts_model_abis_close to indicate ABIS link failure.
sysmocom-bts model shuts down on link loss, but other models may not want
this, so shutdown is moved tor bts_model_abis_close of osmo-bts-sysmo.
2015-09-22 16:41:25 +02:00
Andreas Eversberg
cd0581d815 TRX: On negative response of critical commands, shutdown BTS 2015-09-22 16:41:24 +02:00
Andreas Eversberg
1de7085d31 Add test code for testing GSM burst transcoding 2015-09-22 16:41:24 +02:00
Andreas Eversberg
acc71ffb4b TRX: Introduce osmobts-trx, a layer 1 implementation for OpenBTS tranceivers
The code is quite complete, TCH and PDCH channels are not yet tested.
2015-09-22 16:41:24 +02:00
Andreas Eversberg
c64fa4f888 Change to new structure of multirate at gsm_data_shared.h 2015-09-22 16:41:24 +02:00
Andreas Eversberg
79bc80102c Fix: Call e1inp_vty_init() before reading config file 2015-09-22 16:41:24 +02:00
Andreas Eversberg
5fa388c366 Fix: Process all TRX on GSM Time indication, not only C0 2015-09-22 16:41:24 +02:00
Andreas Eversberg
75f105bbb5 Fix: Retrieve ARFCN (from OML) for TRX other than C0 2015-09-22 16:41:24 +02:00
Ivan Kluchnikov
2340b88ede fix: make sysmobts tests only when sysmobts is enabled 2015-09-22 16:41:24 +02:00
Harald Welte
329085a8ff Merge branch '201509-l1sap' 2015-09-22 16:39:55 +02:00
Harald Welte
819b50e1a7 move MS power control handling from sysmobts to common part
MS uplink power control is required in pretty much any BTS, and we
cannot assume that they PHY / L1 will always take care of it by
itself.   So the correspondign code is moved to common/power_control.c
and called from the generic part of L1SAP.

The corresponding VTY paramter has been moved from the sysmobts-specific
trx VTY node to the common BTS VTY node.
2015-09-22 16:39:05 +02:00
Andreas Eversberg
f449842053 Move detection of handover frames from sysmo-bts code to common code 2015-09-22 16:39:05 +02:00
Andreas Eversberg
9cfbf27d4c Remove obsolete gsmtap handling from osmo-bts-sysmo part. 2015-09-22 16:39:05 +02:00
Andreas Eversberg
a450ef73ed Add gsmtap option to command line to main.c of osmo-bts-sysmo 2015-09-22 16:39:04 +02:00
Andreas Eversberg
04b5d65575 Move gsmtap VTY commands from osmo-bts-sysmo to common part 2015-09-22 16:39:04 +02:00
Andreas Eversberg
90e543bd83 Send primitives at PH-/MPH-/TCH-SAP interface via GSMTAP 2015-09-22 16:39:04 +02:00
Andreas Eversberg
75caaf2949 sysmobts: Clean up transitions for lchan cipher state
There are three transitions:

1. LCHAN_CIPH_NONE -> LCHAN_CIPH_RX_REQ -> LCHAN_CIPH_RX_CONF

It is used to enable ciphering in RX (uplink) direction only.

2. LCHAN_CIPH_RX_CONF -> LCHAN_CIPH_RX_CONF_TX_REQ -> LCHAN_CIPH_RXTX_CONF

It is used to additionally enable ciphering in TX (downlink) direction.

3. LCHAN_CIPH_NONE -> LCHAN_CIPH_RXTX_REQ -> LCHAN_CIPH_RX_CONF_TX_REQ
   -> LCHAN_CIPH_RXTX_CONF

It is used to enable ciphering in both TX and RX directions. This is used
when the channel is activated with encryption already enabled. (assignment
or handover)

In order to follow the order of these transitions, the RX direction must
always be set before the TX direction.

If no cipher key is set (A5/0), ciphering is set to ALG 0, but lchan cipher
state remains at LCHAN_CIPH_NONE.
2015-09-22 16:39:04 +02:00
Andreas Eversberg
5027e122a8 Add MEAS (MPH_INFO) IND message to PH-/MPH-/TCH-SAP interface
This part moves processing of measurement infos from osmo-bts-sysmo to
common part.
2015-09-22 16:39:04 +02:00
Harald Welte
a313bb0a47 l1sap: Port code to new ciphering handling
... introduced in 2cc37035d7
2015-09-22 16:39:04 +02:00
Harald Welte
923e324abc sysmobts/l1_if: Sacch/Sdcc/Facch are handled in l1sap/core 2015-09-22 16:39:04 +02:00
Andreas Eversberg
bac087c207 Add SDCCH/SACCH/FACCH messages to PH-/MPH-/TCH-SAP interface
This part moves control channel message primitives from osmo-bts-sysmo to
common part.

In order to control ciphering fo BTS model, CIPHER (MPH_INFO) messages are
used.
2015-09-22 16:39:04 +02:00
Harald Welte
80f039973e l1sap: Avoid compiler warnings regarding uninitialized nmsg 2015-09-22 16:39:04 +02:00
Harald Welte
3a381367a6 l1sap: Use {data,empty}_req_from_l1sap() and avoid code duplication 2015-09-22 16:39:04 +02:00
Andreas Eversberg
12472df8f0 Add TCH messages to PH-/MPH-/TCH-SAP interface
This part moves TCH handling from osmo-bts-sysmo to common part. The RTP
handling is done at the common part, so they can be used by other BTS
models.
2015-09-22 16:39:04 +02:00
Harald Welte
7cc199ea95 l1sap: re-introduce a comment that was lost during l1sap merge 2015-09-22 16:39:03 +02:00
Andreas Eversberg
793e713c4b Move chan act/rel/modify from bts_model to PH-/MPH-/TCH-SAP interface
This part replaces channel activation/deactivation/modification routines
by MPH_INFO messages.
2015-09-22 16:39:03 +02:00
Andreas Eversberg
faba84b9b7 Relace bts_model_get_time() by get_time() at common part 2015-09-22 16:39:03 +02:00
Harald Welte
7cf313c75b l1sap: Re-introduce more correct RACH slot counting
The original code handled both the fact where a TIME indication would be
missed (and thus the frame number be higher than previous + 1), as well
as the two cases for combined / non-combined CCCH.

The L1SAP code removed some of those bits, which I'm re-introducing
here.
2015-09-22 16:39:03 +02:00
Andreas Eversberg
21b5e6318e Add TIME (MPH_INFO) IND messages to PH-/MPH-/TCH-SAP interface
This part moves GSM time handling from osmo-bts-sysmo part to common part.
2015-09-22 16:39:03 +02:00
Harald Welte
4fe00da9f8 l1sap: additional comments explaining l1sap changes in l1_if.c 2015-09-22 16:39:03 +02:00
Andreas Eversberg
75be092b99 Add PDCH messages to PH-/MPH-/TCH-SAP interface
This part moves PDTCH, PACCH and PTCCH message primitives from
osmo-bts-sysmo to common part.
2015-09-22 16:39:03 +02:00
Harald Welte
c9441b3c0b l1sap: Add a warning about assuming BS_AG_BLKS_RES=1
This is a regression of the code compared to the existing
sysmoBTS code, where the L1 tells us whether its AGCH or
PCH.  However, it was not used even in the old code, so
we can afford to simply put a #warning here.
2015-09-22 16:39:03 +02:00
Andreas Eversberg
ace9a8742f Add PCH/AGCH message to PH-/MPH-/TCH-SAP interface
This part moves PCH and AGCH message primitives from osmo-bts-sysmo to
common part.
2015-09-22 16:39:03 +02:00
Harald Welte
54eceac257 l1sap: sysmobts: remove obsolete get_lapdm_chan_by_hl2() 2015-09-22 16:39:03 +02:00
Harald Welte
d410eb9787 l1sap: correctly set chan_nr on PRIM_PH_RACH / INDICATION
In case of a RACH INDICATION on CCCH, we need to set CHAN_NR to
0x88 (RSL_CHAN_RACH).  In other cases, chan_nr needs to reflect
the actual logical channel (TCH/SDCCH) on whcih the handover happened.
2015-09-22 16:39:02 +02:00
Harald Welte
9ae5b50d78 l1sap: RACH: Detect hand-over even on TRX0
I don't understand why we would detect handover only on TRX1-n,
but not on TRX0.  It is perfectly valid for a handover to occur
on TRX0.
2015-09-22 16:39:02 +02:00
Harald Welte
52476fc1d4 l1sap: fix missing include file and resulting compiler warning 2015-09-22 16:39:02 +02:00
Harald Welte
e969f08892 l1sap: fix coding style 2015-09-22 16:39:02 +02:00
Harald Welte
7b1b832618 l1sap: Use L1SAP_IS_CHAN_RACH instead of magic number 0x88 2015-09-22 16:39:02 +02:00
Andreas Eversberg
e0146997a6 Add RACH message to PH-/MPH-/TCH-SAP interface
This part moves RACH message primitives from osmo-bts-sysmo to common
part.
2015-09-22 16:39:02 +02:00
Harald Welte
a391d3691a l1sap: Split ph_data_req() into smaller parts
... in an effort to avoid introducing new/more spaghetti code

Also, use offsetof() instead of pointer calculation to determine
the start of GsmL1_Prim_t.u.phDataReq.msgUnitParam.u8Buffer
2015-09-22 16:39:02 +02:00
Andreas Eversberg
5e90f2a809 Add BCCH message to PH-/MPH-/TCH-SAP interface
This first part moves BCCH message primitives from osmo-bts-sysmo to common
part. A new file "common/l1sap.c" is introduced to implement handling of
layer 1 messages from/to BTS model.
2015-09-22 16:39:02 +02:00
Holger Hans Peter Freyther
1eaa3d72ea audio/rsl: Honor the speech mode and don't send anything
Spotted by Ciaby while debugging an audio issue. Do not
send anything to port==0 to the BSC/NITB. Look at the
upper bits of the speech_mode to determine if sending is
allowed. 0x1 means recv_only and all other modes allow us
to send.

Manually verified with a single phone call with LCR bridge
mode to send a CRCX early but a MDCX sendrecv later. The
audio starts to flow after the MDCX message. Virtual Addr
space didn't increase over 10 calls. The l1p_msg is freed
by the caller.

The code might not re-set speech_mode from one call to
another but if it is ever != 0 it can be expected that
the BSC will always set it. This is because we do not
(and don't want to) allocate the lchan dynamically on
every usage.

Fixes: SYS#2111
2015-09-21 14:34:22 +02:00
Holger Hans Peter Freyther
668f8df3be audio/rsl: Include statistics for one call
Use the new libosmo-abis API to query the session for the
statistics and then send it as a TLV element to the BSC.
This can be used to do post processing about the call. E.g
to figure out if no audio arrived at all.
2015-09-21 14:34:07 +02:00
Holger Hans Peter Freyther
cc4a08bdc7 audio/rsl: Include the connection identifier in the DLCX ind
I have traces that include the connection identifier in the
DLCX indication.
2015-09-21 10:14:11 +02:00
Harald Welte
862807504b update README to bring it more in sync with reality. 2015-08-21 02:30:24 +02:00
Holger Hans Peter Freyther
a7c276b72b meas: Do not send incomplete measurement reports
The RSL_IE_MEAS_RES_NR is mandatory element with a minimum
of 5 octets (two for TL and three for the value). When we
establish a new channel we might not have had enough time
in a TDMA frame to calculate the average. The issue is not
easy to reproduce. At the point we receive the measurement
report we have two uplink measurements queued. As it is not
easy to reproduce and only occurs when a channel is new
I have decided to drop the message instead of sending made
up uplink measurement reports.

As of now lchan_build_rsl_ul_meas will always return 3 and
the condition will never be false.

Avoids: SYS#1781
2015-07-14 09:55:56 +02:00
Holger Hans Peter Freyther
f869a95f3b write_queue: Check the result of osmo_wqueue_enqueue and free
The write_queue is designed to have a maximum amount of pending
messages and will refuse to take new messages when it has been
reached. The caller can decide if it wants to flush the queue
and add the message again, create a log. But in all cases the
ownership of the msgb has not been transferred. Fix the potential
memory leak in the failure situation.
2015-03-28 18:31:10 +01:00
Andreas Eversberg
0ddd4b6c25 Add header file of PH-/MPH-/TCH-SAP interface to common part of osmo-bts
Instead of handling primitives directly at layer 1 specific code,
osmo-bts handles primitives at common code.

When all primitive are moved, the l1sap interface will:
- receive PH-DATA indications and forward them to layer 2.
- check for RF link loss and notify BSC.
- receive TCH indications and forward them via RTP.
- receive PH-RTS indications and send PH-DATA requests with content
  according to its logical channel.
- receive TCH-RTS indications and send TCH requests with content
  received via RTP or loopback from TCH indications.
- send MPH-INFO requests to activate, deactivate and modify logical
  channels and handle their confirms.
- receive MPH-INFO indications with measurements from tranceiver.
- forward received and transmitted PH-DATA to GSMTAP.
2015-03-25 23:22:00 +01:00
Andreas Eversberg
24839068f5 sysmo-bts: Use correct boundaries of L1 msg when forwarding to L1 proxy
In case of a headroom in a message, the 'head' pointer will not point to
the actual data.
2015-03-25 23:19:58 +01:00
Holger Hans Peter Freyther
b631bd21d2 power: Make it possible to force a power level
Use the standard RSL commands to order a logical channel
to use a fixed power level.

The code is not fully verified and there was a last minute
change to invoke bts_model_adjst_ms_pwr.
2015-02-05 22:32:53 +01:00
Holger Hans Peter Freyther
579651bf30 power/sysmobts: Add a manual ms power level control
Currently the DSP is instructed to achieve a given uplink
power target but there are circumstances (e.g. EMV testing)
where we need more control over it. The "manual/software/osmo"
power control can only be implemented per TRX and not per
lchan. Add a very very basic control that checks the MS Power
used by the phone, the actual receive level and then adjust
the power.

The code doesn't take the history into account, if the phone
can not reach the requested power level the code will be stuck
(e.g. no timeout based on multiframes). It has a mode for a
fixed power control but no way to set it yet.

The change of the mode requires a restart of the software.
2015-02-05 22:32:47 +01:00
Holger Hans Peter Freyther
0d6946741c sysmobts: Check mgr->calib.bts_conn for NULL
Check the right variable for NULL.

Fixes: CID 1262214
2015-01-10 18:06:29 +01:00
Holger Hans Peter Freyther
7e10bd6401 misc: Fix up testcase after 5a03e129a6
In 5a03e129a6 we generalized the
structural parser so we need to update the expected behavior of
that routine.
2015-01-10 13:07:49 +01:00
Holger Hans Peter Freyther
84e4dd92d4 sysmobts: Improve some log messages for calib control
* Print the GPS FD that was opened (e.g. to see if it was
  closed again)
* Print the state changes/expectations
* Print the correct to be applied. I wondered if I shouldo do
  a cor = cor * -1.. cor = -cor.. or add CLOCK_CORR(err) macro
  to use it inside the printf and correction and decided the
  gain is not worth the risk.
2015-01-10 09:15:27 +01:00
Holger Hans Peter Freyther
55da9874c0 sysmobts: Create a calibration loop that will be run
Continously run the calibration process. Everytime we call the
reset function classify the outcome. In case of a failure schedule
the next command soon and otherwise wait several hours.

Remember if the process was started through the VTY or the run
loop. In case it can't be started immediately reset and schedule
a new run.
2015-01-09 21:57:13 +01:00
Holger Hans Peter Freyther
d8d5f5904f sysmobts: Start the calibration the first time the link is up
After a reboot the system might have been off for a long time
and the currently used value might be wrong. Remember that we
never ran the calibration and execute it on start.
2015-01-09 21:57:13 +01:00
Holger Hans Peter Freyther
9acc82ce4a sysmobts: Initial version to use libgps to determine FIX state
We should only calibrate the clock if there is a GPS fix. Start
gpsd to determine if there is a fix or not. Work around trimble
decoding issues (sent an email upstream). We need to gain some
more experience to see if there memory leaks. We also need to
re-schedule the calibration depending on the outcome.
2015-01-09 21:57:13 +01:00
Holger Hans Peter Freyther
c017e309c4 sysmobts: The correction for GPS is in the reverse direction
Change the sign before passing it as correction value. The error
is the difference between the TCXO and GPS. We need to correct by
the reverse of the error. This seems to be different depending on
the clock source we have.

This is a last minute untested change.
2015-01-09 21:57:13 +01:00
Holger Hans Peter Freyther
2e59b20204 sysmobts: Use the ctrl interface for calibration
This runs the entire procedure for calibration with reasonable
error and success checking. It can be triggered from the VTY
of the sysmobts-mgr right now.

What is missing is to hook up with GPSD to check if the system
has a fix and provide a mode that will continously run the
calibration command.
2015-01-09 21:57:13 +01:00
Holger Hans Peter Freyther
fd425b1484 sysmobts: Copy more of l1if_rf_clock_info_reset into the CTRL code
The CTRL code should have used/extended the l1_if calibration
code. The sysmobts-mgr code first needs to determine if the
clock adjustment is necessary at all. This is done by first
resetting the counters, then waiting, then asking for the diff
and then applying the correction value. But the reference clock
is only set by the application comand.

Copy more code of l1if_rf_clock_info_reset to set the reference
clock as value. This is leaving some todos inside the code that
will be resolved as part of SYS#835.

Related: SYS#835
2015-01-09 21:57:13 +01:00
Holger Hans Peter Freyther
50131c125e sysmobts: Begin with calib control from the sysmobts manager
In the long run we will connect to GPSD and wait for a fix and
then run the calibration. The first step is to open (and re-open)
the control connection to the BTS.

As the connection is on localhost there should not be a computation
overhead to always have the connection open. When connecting assume
that the ASYNC connect worked directly as otherwise we get no
notification of the failure.

This looks like a "bug" of libosmo-abis that should check if the
socket has been connected or not.
2015-01-09 21:57:13 +01:00
Holger Hans Peter Freyther
5a03e129a6 msg: Generalize the message structure test
This was taken out of LaF0rge's OML router branch and is now
used by the extended calibration feature.
2015-01-09 21:57:13 +01:00
Holger Hans Peter Freyther
b7ebf545e6 cbch: Speculative change to not change CHAN ACK for CBCH
Use the rel_act_kind to not send RSL channel acks for the
CBCH to the BSC. This is similar to what we do for the BCCH
a couple of lines above.
2015-01-06 19:23:02 +01:00
Harald Welte
8fc2630dd4 SMS-CB: Clean up + centralize generation of NULL block 2014-12-30 13:45:02 +01:00
Harald Welte
bd988f6ad3 SMS-CB: Use GSM412_SEQ_NULL_MSG rather than 0xf 2014-12-30 13:34:57 +01:00
Harald Welte
1e245336ec SMS-CB: use gsm412_block_type from libosmocore
.. and not our own local re-definition of the structure.
2014-12-30 13:33:54 +01:00
Harald Welte
4457c0d9ba SMS-CB: Use GSM412_ #defines from libosmocore rather than our own 2014-12-30 13:32:52 +01:00
Harald Welte
660116fb9d CBCH: Implement CBCH block segmentation and RSL_MT_SMS_BC_CMD
* CBCH load indications are not yet sent
* The queue length is not yet limited!
2014-12-30 00:32:13 +01:00
Harald Welte
b15d2c9d2f Initial CBCH support
This should handle OML channel combinations with CBCH and activate the
CBCH SAPI towards the DSP correspondingly.  What is still missing is
sending any actual information over the CBCH in respons to the
PH-RTS.ind coming up from L1.
2014-12-30 00:28:31 +01:00
352 changed files with 72115 additions and 3710 deletions

55
.gitignore vendored
View File

@@ -19,16 +19,38 @@ depcomp
install-sh
missing
stamp-h1
libtool
ltmain.sh
core
core.*
contrib/sysmobts-calib/sysmobts-calib
# git-version-gen magic
.tarball-version
.version
src/osmo-bts-sysmo/sysmobts-calib
src/osmo-bts-sysmo/l1fwd-proxy
src/osmo-bts-sysmo/sysmobts
src/osmo-bts-sysmo/sysmobts-remote
src/osmo-bts-sysmo/osmo-bts-sysmo
src/osmo-bts-sysmo/osmo-bts-sysmo-remote
src/osmo-bts-sysmo/sysmobts-mgr
src/osmo-bts-sysmo/sysmobts-util
src/osmo-bts-litecell15/lc15bts-mgr
src/osmo-bts-litecell15/lc15bts-util
src/osmo-bts-litecell15/misc/.dirstamp
src/osmo-bts-litecell15/osmo-bts-lc15
src/osmo-bts-trx/osmo-bts-trx
src/osmo-bts-octphy/osmo-bts-octphy
src/osmo-bts-virtual/osmo-bts-virtual
src/osmo-bts-omldummy/osmo-bts-omldummy
src/osmo-bts-oc2g/osmo-bts-oc2g
src/osmo-bts-oc2g/oc2gbts-mgr
src/osmo-bts-oc2g/oc2gbts-util
src/osmo-bts-oc2g/misc/.dirstamp
tests/atconfig
tests/package.m4
@@ -36,7 +58,10 @@ tests/agch/agch_test
tests/paging/paging_test
tests/cipher/cipher_test
tests/sysmobts/sysmobts_test
tests/meas/meas_test
tests/misc/misc_test
tests/handover/handover_test
tests/tx_power/tx_power_test
tests/testsuite
tests/testsuite.log
@@ -44,6 +69,30 @@ tests/testsuite.log
doc/vty_reference.xml
# Backups, vi, merges
*~
*.sw?
*.orig
*.sav
# debian
.tarball-version
debian/autoreconf.after
debian/autoreconf.before
debian/files
debian/*.debhelper.log
debian/*.substvars
debian/osmo-bts-trx-dbg/
debian/osmo-bts-trx/
debian/tmp/
/tests/power/power_test
# manuals
doc/manuals/*.html
doc/manuals/*.svg
doc/manuals/*.pdf
doc/manuals/*__*.png
doc/manuals/*.check
doc/manuals/generated/
doc/manuals/osmomsc-usermanual.xml
doc/manuals/common
doc/manuals/build

3
.gitreview Normal file
View File

@@ -0,0 +1,3 @@
[gerrit]
host=gerrit.osmocom.org
project=osmo-bts

12
.mailmap Normal file
View File

@@ -0,0 +1,12 @@
Harald Welte <laforge@gnumonks.org>
Harald Welte <laforge@gnumonks.org> <laflocal@hanuman.gnumonks.org>
Harald Welte <laforge@gnumonks.org> <laflocal@goeller.de.gnumonks.org>
Holger Hans Peter Freyther <holger@moiji-mobile.com> <zecke@selfish.org>
Holger Hans Peter Freyther <holger@moiji-mobile.com> <ich@tamarin.(none)>
Holger Hans Peter Freyther <holgre@moiji-mobile.com> <holger@freyther.de>
Andreas Eversberg <jolly@eversberg.eu>
Andreas Eversberg <jolly@eversberg.eu> <Andreas.Eversberg@versatel.de>
Andreas Eversberg <jolly@eversberg.eu> <root@nuedel.(none)>
Pablo Neira Ayuso <pablo@soleta.eu> <pablo@gnumonks.org>
Max Suraev <msuraev@sysmocom.de>
Tom Tsou <tom.tsou@ettus.com> <tom@tsou.cc>

View File

@@ -1,15 +1,22 @@
AUTOMAKE_OPTIONS = foreign dist-bzip2 1.6
SUBDIRS = include src tests
SUBDIRS = include src tests doc contrib
# package the contrib and doc
EXTRA_DIST = \
contrib/dump_docs.py contrib/screenrc-l1fwd contrib/sysmobts.service \
contrib/l1fwd.init contrib/screenrc-sysmobts contrib/respawn.sh \
contrib/sysmobts.init contrib/sysmobts-calib/Makefile \
contrib/sysmobts-calib/sysmobts-calib.c \
contrib/sysmobts-calib/sysmobts-layer1.c \
contrib/sysmobts-calib/sysmobts-layer1.h \
doc/examples/osmo-bts.cfg \
doc/examples/sysmobts-mgr.cfg
contrib/dump_docs.py \
git-version-gen .version \
README.md
AM_DISTCHECK_CONFIGURE_FLAGS = \
--with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
@RELMAKE@
BUILT_SOURCES = $(top_srcdir)/.version
$(top_srcdir)/.version:
echo $(VERSION) > $@-t && mv $@-t $@
dist-hook:
echo $(VERSION) > $(distdir)/.tarball-version

59
README
View File

@@ -1,59 +0,0 @@
Repository for new the Osmocom BTS implementation.
This code implementes the Layer 2 and higher of a more or less
conventional GSM BTS (Base Transceiver Station) - however, using an
Abis/IP interface, rather than the old-fashioned E1/T1.
Specificallt, this includes
* BTS-Side implementation of TS 08.58 (RSL) and TS 12.21 (OML)
* BTS-Side implementation of LAPDm (using libosmocore/libosmogsm)
* A somewhat separated interface between those higher layer parts
and the Layer1 interface.
Right now, only one hardware and Layer1 are supported: The sysmocom
sysmoBTS.
There is some experimental and way incomplete code to use a couple of
OsmocomBB phones and run them in the BTS. However, the required code
for the Calypso DSP code have not been written yet. This would still
require a lot of work.
Some additional work is being done in using some parts of the OpenBTS
L1FEC and glue it against omso-bts. However, this is also still in an
early, experimental stage.
== Known Limitations ==
As of June 3, 2012, the following known limitations exist in this
implementation:
=== Common Core ===
* No Extended BCCH support
* System Information limited to 1,2,2bis,2ter,2quater,3,4,5,6,9,13
* No RATSCCH in AMR
* No OML (TS 12.21) alarms yet (temperature, ...)
* Only single-TRX BTS at this point
* Will reject TS 12.21 STARTING TIME in SET BTS ATTR / SET CHAN ATTR
* No support for frequency hopping
* No reporting of interference levels as part of TS 08.58 RF RES IND
* No error reporting in case PAGING COMMAND fails due to queue overflow
* No hand-over support (planned)
* No use of TS 08.58 BS Power and MS Power parameters
* No support of TS 08.58 MultiRate Control
* No support of TS 08.58 Supported Codec Types
* No support of Bter frame / ENHANCED MEASUREMENT REPORT
=== osmo-bts-sysmo ===
* No CSD / ECSD support (not planned)
* No GPRS/EDGE support (planned)
* GSM-R frequency band supported, but no NCH/ASCI/SoLSA
* All timeslots on one TRX have to use same training sequence (TSC)
* No multi-TRX support yet, though hardware+L1 support stacking
* Makes no use of 12.21 Intave Parameters and Interference
Level Boundaries
* Makes no use of TS 12.21 T3105
* Doesn't yet include MAC address in Abis/IP Identity message
* MphConfig.CNF can be returned to the wrong callback. E.g. with Tx Power
and ciphering. The dispatch should take a look at the hLayer3.

119
README.md Normal file
View File

@@ -0,0 +1,119 @@
osmo-bts - Osmocom BTS Implementation
====================================
This repository contains a C-language implementation of a GSM Base
Transceiver Station (BTS). It is part of the
[Osmocom](https://osmocom.org/) Open Source Mobile Communications
project.
This code implements Layer 2 and higher of a more or less conventional GSM BTS
(Base Transceiver Station) - however, using an Abis/IP interface, rather than
the old-fashioned E1/T1.
Specifically, this includes
* BTS-side implementation of TS 08.58 (RSL) and TS 12.21 (OML)
* BTS-side implementation of LAPDm (using libosmocore/libosmogsm)
* A somewhat separated interface between those higher layer parts and the
Layer1 interface.
Several kinds of BTS hardware are supported:
* sysmocom sysmoBTS
* Octasic octphy
* Nutaq litecell 1.5
* software-defined radio based osmo-bts-trx (e.g. USRP B210, UmTRX, LimeSDR)
Homepage
--------
The official homepage of the project is
https://osmocom.org/projects/osmobts/wiki
GIT Repository
--------------
You can clone from the official osmo-bts.git repository using
git clone git://git.osmocom.org/osmo-bts.git
There is a cgit interface at http://git.osmocom.org/osmo-bts/
Documentation
-------------
We provide a
[User Manual](http://ftp.osmocom.org/docs/latest/osmobts-usermanual.pdf)
as well as a
[VTY Reference Manual](http://ftp.osmocom.org/docs/latest/osmobsc-vty-reference.pdf)
and a
[Abis reference MAnual](http://ftp.osmocom.org/docs/latest/osmobts-abis.pdf)
describing the OsmoBTS specific A-bis dialect.
Mailing List
------------
Discussions related to osmo-bts are happening on the
openbsc@lists.osmocom.org mailing list, please see
https://lists.osmocom.org/mailman/listinfo/openbsc for subscription
options and the list archive.
Please observe the [Osmocom Mailing List
Rules](https://osmocom.org/projects/cellular-infrastructure/wiki/Mailing_List_Rules)
when posting.
Contributing
------------
Our coding standards are described at
https://osmocom.org/projects/cellular-infrastructure/wiki/Coding_standards
We us a gerrit based patch submission/review process for managing
contributions. Please see
https://osmocom.org/projects/cellular-infrastructure/wiki/Gerrit for
more details
The current patch queue for osmo-bts can be seen at
https://gerrit.osmocom.org/#/q/project:osmo-bts+status:open
Known Limitations
=================
As of March 17, 2017, the following known limitations exist in this
implementation:
Common Core
-----------
* No Extended BCCH support
* System Information limited to 1,2,2bis,2ter,2quater,3,4,5,6,9,13
* No RATSCCH in AMR
* Will reject TS 12.21 STARTING TIME in SET BTS ATTR / SET CHAN ATTR
* No support for frequency hopping
* No reporting of interference levels as part of TS 08.58 RF RES IND
* No error reporting in case PAGING COMMAND fails due to queue overflow
* No use of TS 08.58 BS Power and MS Power parameters
* No support of TS 08.58 MultiRate Control
* No support of TS 08.58 Supported Codec Types
* No support of Bter frame / ENHANCED MEASUREMENT REPORT
osmo-bts-sysmo
--------------
* No CSD / ECSD support (not planned)
* GSM-R frequency band supported, but no NCH/ASCI/SoLSA
* All timeslots on one TRX have to use same training sequence (TSC)
* No multi-TRX support yet, though hardware+L1 support stacking
* Makes no use of 12.21 Intave Parameters and Interference
Level Boundaries
* MphConfig.CNF can be returned to the wrong callback. E.g. with Tx Power
and ciphering. The dispatch should take a look at the hLayer3.
osmo-bts-octphy
---------------
* No support of EFR, HR voice codec (lack of PHY support?)
* No re-transmission of PHY primitives in case of time-out
* Link Quality / Measurement processing incomplete
* impossible to modify encryption parameters using RSL MODE MODIFY
* no clear indication of nominal transmit power, various power related
computations are likely off
* no OML attribute validation during bts_model_check_oml()

View File

@@ -1,7 +1,10 @@
dnl Process this file with autoconf to produce a configure script
AC_INIT([osmo-bts],
m4_esyscmd([./git-version-gen .tarball-version]),
[openbsc-devel@lists.openbsc.org])
[openbsc@lists.osmocom.org])
dnl *This* is the root dir, even if an install-sh exists in ../ or ../../
AC_CONFIG_AUX_DIR([.])
AM_INIT_AUTOMAKE([dist-bzip2])
AC_CONFIG_TESTDIR(tests)
@@ -9,66 +12,367 @@ AC_CONFIG_TESTDIR(tests)
dnl kernel style compile messages
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
dnl include release helper
RELMAKE='-include osmo-release.mk'
AC_SUBST([RELMAKE])
dnl checks for programs
AC_PROG_MAKE_SET
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_RANLIB
LT_INIT
dnl check for pkg-config (explained in detail in libosmocore/configure.ac)
AC_PATH_PROG(PKG_CONFIG_INSTALLED, pkg-config, no)
if test "x$PKG_CONFIG_INSTALLED" = "xno"; then
AC_MSG_WARN([You need to install pkg-config])
fi
PKG_PROG_PKG_CONFIG([0.20])
dnl checks for header files
AC_HEADER_STDC
dnl Checks for typedefs, structures and compiler characteristics
dnl checks for libraries
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 0.3.9)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty)
PKG_CHECK_MODULES(LIBOSMOTRAU, libosmotrau >= 0.0.7)
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.3.3)
PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl)
PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis)
AC_ARG_ENABLE(sanitize,
[AS_HELP_STRING([--enable-sanitize], [Compile with address sanitizer enabled], )],
[sanitize=$enableval], [sanitize="no"])
if test x"$sanitize" = x"yes"
then
CFLAGS="$CFLAGS -fsanitize=address -fsanitize=undefined"
CPPFLAGS="$CPPFLAGS -fsanitize=address -fsanitize=undefined"
fi
AC_MSG_CHECKING([whether to enable sysmocom-bts hardware support])
AC_ARG_ENABLE(werror,
[AS_HELP_STRING(
[--enable-werror],
[Turn all compiler warnings into errors, with exceptions:
a) deprecation (allow upstream to mark deprecation without breaking builds);
b) "#warning" pragmas (allow to remind ourselves of errors without breaking builds)
]
)],
[werror=$enableval], [werror="no"])
if test x"$werror" = x"yes"
then
WERROR_FLAGS="-Werror"
WERROR_FLAGS+=" -Wno-error=deprecated -Wno-error=deprecated-declarations"
WERROR_FLAGS+=" -Wno-error=cpp" # "#warning"
CFLAGS="$CFLAGS $WERROR_FLAGS"
CPPFLAGS="$CPPFLAGS $WERROR_FLAGS"
fi
dnl checks for libraries
PKG_CHECK_MODULES(LIBOSMOCORE, libosmocore >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 1.3.0)
PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.6.0)
PKG_CHECK_MODULES(LIBOSMOTRAU, libosmotrau >= 0.6.0)
AC_MSG_CHECKING([whether to enable support for sysmobts calibration tool])
AC_ARG_ENABLE(sysmobts-calib,
AC_HELP_STRING([--enable-sysmobts-calib],
[enable code for sysmobts calibration tool [default=no]]),
[enable_sysmobts_calib="yes"],[enable_sysmobts_calib="no"])
AC_MSG_RESULT([$enable_sysmobts_calib])
AM_CONDITIONAL(ENABLE_SYSMOBTS_CALIB, test "x$enable_sysmobts_calib" = "xyes")
AC_MSG_CHECKING([whether to enable support for sysmoBTS L1/PHY support])
AC_ARG_ENABLE(sysmocom-bts,
AC_HELP_STRING([--enable-sysmocom-bts],
[enable code for sysmocom femto-bts [default=no]]),
[enable code for sysmoBTS L1/PHY [default=no]]),
[enable_sysmocom_bts="yes"],[enable_sysmocom_bts="no"])
AC_ARG_WITH([sysmobts], [AS_HELP_STRING([--with-sysmobts=INCLUDE_DIR], [Location of the sysmobts API header files, implies --enable-sysmocom-bts])],
[sysmobts_incdir="$withval"],[sysmobts_incdir="$incdir"])
if test "x$sysmobts_incdir" != "x"; then
# --with-sysmobts was passed, imply enable_sysmocom_bts
enable_sysmocom_bts="yes"
fi
AC_SUBST([SYSMOBTS_INCDIR], -I$sysmobts_incdir)
AC_MSG_RESULT([$enable_sysmocom_bts])
AM_CONDITIONAL(ENABLE_SYSMOBTS, test "x$enable_sysmocom_bts" = "xyes")
if test "$enable_sysmocom_bts" = "yes"; then
oldCPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $SYSMOBTS_INCDIR -I$srcdir/include"
AC_CHECK_HEADER([sysmocom/femtobts/superfemto.h],[],
[AC_MSG_ERROR([sysmocom/femtobts/superfemto.h can not be found in $sysmobts_incdir])],
[#include <sysmocom/femtobts/superfemto.h>])
# We share gsm_data.h with OpenBSC and need to be pointed to the source
# directory of OpenBSC for now.
AC_ARG_WITH([openbsc],
[AS_HELP_STRING([--with-openbsc=INCLUDE_DIR],
[OpenBSC include directory for openbsc/gsm_data_shared.h])],
[openbsc_incdir="$withval"],
[openbsc_incdir="`cd $srcdir; pwd`/../openbsc/openbsc/include"])
AC_SUBST([OPENBSC_INCDIR], $openbsc_incdir)
oldCPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$OPENBSC_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS"
AC_CHECK_HEADER([openbsc/gsm_data_shared.h],[],
[AC_MSG_ERROR([openbsc/gsm_data_shared.h can not be found in $openbsc_incdir])],
[#include <osmo-bts/tx_power.h>])
CPPFLAGS=$oldCPPFLAGS
# Check for the sbts2050_header.h that was added after the 3.6 release
oldCPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I$OPENBSC_INCDIR $LIBOSMOCORE_CFLAGS"
AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h],
[sysmo_uc_header="yes"],[])
CPPFLAGS=$oldCPPFLAGS
if test "$sysmo_uc_header" = "yes" ; then
# Check for the sbts2050_header.h that was added after the 3.6 release
AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h], [sysmo_uc_header="yes"], [])
if test "$sysmo_uc_header" = "yes" ; then
AC_DEFINE(BUILD_SBTS2050, 1, [Define if we want to build SBTS2050])
fi
PKG_CHECK_MODULES(LIBGPS, libgps)
CPPFLAGS=$oldCPPFLAGS
fi
AM_CONDITIONAL(BUILD_SBTS2050, test "x$sysmo_uc_header" = "xyes")
AC_MSG_CHECKING([whether to enable support for osmo-trx based L1/PHY support])
AC_ARG_ENABLE(trx,
AC_HELP_STRING([--enable-trx],
[enable code for osmo-trx L1/PHY [default=no]]),
[enable_trx="yes"],[enable_trx="no"])
AC_MSG_RESULT([$enable_trx])
AM_CONDITIONAL(ENABLE_TRX, test "x$enable_trx" = "xyes")
AC_MSG_CHECKING([whether to enable support for Octasic OCTPHY-2G])
AC_ARG_ENABLE(octphy,
AC_HELP_STRING([--enable-octphy],
[enable code for Octasic OCTPHY-2G [default=no]]),
[enable_octphy="yes"],[enable_octphy="no"])
AC_ARG_WITH([octsdr-2g], [AS_HELP_STRING([--with-octsdr-2g], [Location of the OCTSDR-2G API header files])],
[octsdr2g_incdir="$withval"],[octsdr2g_incdir="`cd $srcdir; pwd`/src/osmo-bts-octphy/"])
AC_SUBST([OCTSDR2G_INCDIR], -I$octsdr2g_incdir)
AC_MSG_RESULT([$enable_octphy])
AM_CONDITIONAL(ENABLE_OCTPHY, test "x$enable_octphy" = "xyes")
if test "$enable_octphy" = "yes" ; then
oldCPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $OCTSDR2G_INCDIR -I$srcdir/include"
AC_CHECK_HEADER([octphy/octvc1/gsm/octvc1_gsm_default.h],[],
[AC_MSG_ERROR([octphy/octvc1/gsm/octvc1_gsm_default.h can not be found in $octsdr2g_incdir])],
[#include <octphy/octvc1/gsm/octvc1_gsm_default.h>])
AC_CHECK_MEMBER([tOCTVC1_GSM_TRX_CONFIG.usCentreArfcn],
AC_DEFINE([OCTPHY_MULTI_TRX],
[1],
[Define to 1 if your octphy header files support multi-trx]),
[],
[#include <octphy/octvc1/gsm/octvc1_gsm_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_RF_PORT_RX_STATS.Frequency],
AC_DEFINE([OCTPHY_USE_FREQUENCY],
[1],
[Define to 1 if your octphy header files support tOCTVC1_RADIO_FREQUENCY_VALUE type]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_RF_PORT_INFO_ANTENNA_TX_CONFIG_RSP.TxConfig],
AC_DEFINE([OCTPHY_USE_TX_CONFIG],
[1],
[Define to 1 if your octphy header files support tOCTVC1_HW_RF_PORT_ANTENNA_TX_CONFIG type]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_RF_PORT_INFO_ANTENNA_RX_CONFIG_RSP.RxConfig],
AC_DEFINE([OCTPHY_USE_RX_CONFIG],
[1],
[Define to 1 if your octphy header files support tOCTVC1_HW_RF_PORT_ANTENNA_RX_CONFIG type]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_GSM_RF_CONFIG.ulTxAntennaId],
AC_DEFINE([OCTPHY_USE_ANTENNA_ID],
[1],
[Define to 1 if your octphy header files support antenna ids in tOCTVC1_GSM_RF_CONFIG]),
[],
[#include <octphy/octvc1/gsm/octvc1_gsm_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_INFO_RSP.ulClkSourceSelection],
AC_DEFINE([OCTPHY_USE_CLK_SOURCE_SELECTION],
[1],
[Define to 1 if your octphy header files supports ulClkSourceSelection in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_INFO_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.lClockError],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_CLOCK_ERROR],
[1],
[Define to 1 if your octphy header files supports lClockError in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.lDroppedCycles],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_DROPPED_CYCLES],
[1],
[Define to 1 if your octphy header files supports lDroppedCycles in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulPllFreqHz],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_PLL_FREQ_HZ],
[1],
[Define to 1 if your octphy header files supports ulPllFreqHz in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulPllFractionalFreqHz],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_PLL_FRACTIONAL_FREQ_HZ],
[1],
[Define to 1 if your octphy header files supports ulPllFractionalFreqHz in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulSlipCnt],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_SLIP_CNT],
[1],
[Define to 1 if your octphy header files supports ulSlipCnt in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulSyncLosseCnt],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_SYNC_LOSSE_CNT],
[1],
[Define to 1 if your octphy header files supports ulSyncLosseCnt in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulSyncLossCnt],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_SYNC_LOSS_CNT],
[1],
[Define to 1 if your octphy header files supports ulSyncLossCnt in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulSourceState],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_SOURCE_STATE],
[1],
[Define to 1 if your octphy header files supports ulSourceState in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulDacState],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_DAC_STATE],
[1],
[Define to 1 if your octphy header files supports ulDacState in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulDriftElapseTimeUs],
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_DRIFT_ELAPSE_TIME_US],
[1],
[Define to 1 if your octphy header files supports ulDriftElapseTimeUs in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_GSM_MSG_OVERSAMPLE_SELECT_16X_MODIFY_CMD.ulOversample16xEnableFlag],
AC_DEFINE([OCTPHY_USE_16X_OVERSAMPLING],
[1],
[Define to 1 if your octphy header files support 16x oversampling]),
[],
[#include <octphy/octvc1/gsm/octvc1_gsm_api.h>])
CPPFLAGS=$oldCPPFLAGS
fi
AC_MSG_CHECKING([whether to enable NuRAN Wireless Litecell 1.5 hardware support])
AC_ARG_ENABLE(litecell15,
AC_HELP_STRING([--enable-litecell15],
[enable code for NuRAN Wireless Litecell15 bts [default=no]]),
[enable_litecell15="yes"],[enable_litecell15="no"])
AC_ARG_WITH([litecell15], [AS_HELP_STRING([--with-litecell15=INCLUDE_DIR], [Location of the litecell 1.5 API header files])],
[litecell15_incdir="$withval"],[litecell15_incdir="$incdir"])
AC_SUBST([LITECELL15_INCDIR], -I$litecell15_incdir)
AC_MSG_RESULT([$enable_litecell15])
AM_CONDITIONAL(ENABLE_LC15BTS, test "x$enable_litecell15" = "xyes")
if test "$enable_litecell15" = "yes"; then
oldCPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $LITECELL15_INCDIR -I$srcdir/include"
AC_CHECK_HEADER([nrw/litecell15/litecell15.h],[],
[AC_MSG_ERROR([nrw/litecell15/litecell15.h can not be found in $litecell15_incdir])],
[#include <nrw/litecell15/litecell15.h>])
PKG_CHECK_MODULES(LIBSYSTEMD, libsystemd)
CPPFLAGS=$oldCPPFLAGS
fi
AC_MSG_CHECKING([whether to enable NuRAN Wireless OC-2G hardware support])
AC_ARG_ENABLE(oc2g,
AC_HELP_STRING([--enable-oc2g],
[enable code for NuRAN Wireless OC-2G bts [default=no]]),
[enable_oc2g="yes"],[enable_oc2g="no"])
AC_ARG_WITH([oc2g], [AS_HELP_STRING([--with-oc2g=INCLUDE_DIR], [Location of the OC-2G API header files])],
[oc2g_incdir="$withval"],[oc2g_incdir="$incdir"])
AC_SUBST([OC2G_INCDIR], -I$oc2g_incdir)
AC_MSG_RESULT([$enable_oc2g])
AM_CONDITIONAL(ENABLE_OC2GBTS, test "x$enable_oc2g" = "xyes")
if test "$enable_oc2g" = "yes"; then
oldCPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $OC2G_INCDIR -I$srcdir/include"
AC_CHECK_HEADER([nrw/oc2g/oc2g.h],[],
[AC_MSG_ERROR([nrw/oc2g/oc2g.h can not be found in $oc2g_incdir])],
[#include <nrw/oc2g/oc2g.h>])
PKG_CHECK_MODULES(LIBSYSTEMD, libsystemd)
PKG_CHECK_MODULES(LIBGPS, libgps)
CPPFLAGS=$oldCPPFLAGS
fi
# Generate manuals
AC_ARG_ENABLE(manuals,
[AS_HELP_STRING(
[--enable-manuals],
[Generate manual PDFs [default=no]],
)],
[osmo_ac_build_manuals=$enableval], [osmo_ac_build_manuals="no"])
AM_CONDITIONAL([BUILD_MANUALS], [test x"$osmo_ac_build_manuals" = x"yes"])
AC_ARG_VAR(OSMO_GSM_MANUALS_DIR, [path to common osmo-gsm-manuals files, overriding pkg-config and "../osmo-gsm-manuals"
fallback])
if test x"$osmo_ac_build_manuals" = x"yes"
then
# Find OSMO_GSM_MANUALS_DIR (env, pkg-conf, fallback)
if test -n "$OSMO_GSM_MANUALS_DIR"; then
echo "checking for OSMO_GSM_MANUALS_DIR... $OSMO_GSM_MANUALS_DIR (from env)"
else
OSMO_GSM_MANUALS_DIR="$($PKG_CONFIG osmo-gsm-manuals --variable=osmogsmmanualsdir 2>/dev/null)"
if test -n "$OSMO_GSM_MANUALS_DIR"; then
echo "checking for OSMO_GSM_MANUALS_DIR... $OSMO_GSM_MANUALS_DIR (from pkg-conf)"
else
OSMO_GSM_MANUALS_DIR="../osmo-gsm-manuals"
echo "checking for OSMO_GSM_MANUALS_DIR... $OSMO_GSM_MANUALS_DIR (fallback)"
fi
fi
if ! test -d "$OSMO_GSM_MANUALS_DIR"; then
AC_MSG_ERROR("OSMO_GSM_MANUALS_DIR does not exist! Install osmo-gsm-manuals or set OSMO_GSM_MANUALS_DIR.")
fi
# Find and run check-depends
CHECK_DEPENDS="$OSMO_GSM_MANUALS_DIR/check-depends.sh"
if ! test -x "$CHECK_DEPENDS"; then
CHECK_DEPENDS="osmo-gsm-manuals-check-depends"
fi
if ! $CHECK_DEPENDS; then
AC_MSG_ERROR("missing dependencies for --enable-manuals")
fi
# Put in Makefile with absolute path
OSMO_GSM_MANUALS_DIR="$(realpath "$OSMO_GSM_MANUALS_DIR")"
AC_SUBST([OSMO_GSM_MANUALS_DIR])
fi
# https://www.freedesktop.org/software/systemd/man/daemon.html
AC_ARG_WITH([systemdsystemunitdir],
[AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files])],,
[with_systemdsystemunitdir=auto])
AS_IF([test "x$with_systemdsystemunitdir" = "xyes" -o "x$with_systemdsystemunitdir" = "xauto"], [
def_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)
AS_IF([test "x$def_systemdsystemunitdir" = "x"],
[AS_IF([test "x$with_systemdsystemunitdir" = "xyes"],
[AC_MSG_ERROR([systemd support requested but pkg-config unable to query systemd package])])
with_systemdsystemunitdir=no],
[with_systemdsystemunitdir="$def_systemdsystemunitdir"])])
AS_IF([test "x$with_systemdsystemunitdir" != "xno"],
[AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])])
AM_CONDITIONAL([HAVE_SYSTEMD], [test "x$with_systemdsystemunitdir" != "xno"])
AC_MSG_RESULT([CFLAGS="$CFLAGS"])
AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])
AM_CONFIG_HEADER(btsconfig.h)
AC_OUTPUT(
src/Makefile
src/common/Makefile
src/osmo-bts-virtual/Makefile
src/osmo-bts-omldummy/Makefile
src/osmo-bts-sysmo/Makefile
src/osmo-bts-litecell15/Makefile
src/osmo-bts-oc2g/Makefile
src/osmo-bts-trx/Makefile
src/osmo-bts-octphy/Makefile
include/Makefile
include/osmo-bts/Makefile
tests/Makefile
@@ -77,4 +381,13 @@ AC_OUTPUT(
tests/cipher/Makefile
tests/sysmobts/Makefile
tests/misc/Makefile
tests/handover/Makefile
tests/tx_power/Makefile
tests/power/Makefile
tests/meas/Makefile
doc/Makefile
doc/examples/Makefile
doc/manuals/Makefile
contrib/Makefile
contrib/systemd/Makefile
Makefile)

1
contrib/Makefile.am Normal file
View File

@@ -0,0 +1 @@
SUBDIRS = systemd

89
contrib/dtx_check.gawk Executable file
View File

@@ -0,0 +1,89 @@
#!/usr/bin/gawk -f
# Expected input format: FN TYPE
BEGIN {
DELTA = 0
ERR = 0
FORCE = 0
FN = 0
SILENCE = 0
TYPE = ""
CHK = ""
U_MAX = 8 * 20 + 120 / 26
U_MIN = 8 * 20 - 120 / 26
F_MAX = 3 * 20 + 120 / 26
F_MIN = 3 * 20 - 120 / 26
}
{
if (NR > 2) { # we have data from previous record to compare to
DELTA = ($1 - FN) * 120 / 26
CHK = "OK"
if ("FACCH" == $2 && "ONSET" == TYPE) { # ONSET due to FACCH is NOT a talkspurt
SILENCE = 1
}
if (("UPDATE" == TYPE || "FIRST" == TYPE) && ("FACCH" == $2 || "SPEECH" == $2)) { # check for missing ONSET:
CHK = "FAIL: missing ONSET (" $2 ") after " TYPE "."
ERR++
}
if ("SID_P1" == $2) {
CHK = "FAIL: regular AMR payload with FT SID and STI=0 (should be either pyaload Update or STI=1)."
ERR++
}
if ("FORCED_FIRST" == $2 || "FORCED_NODATA" == $2 || "FORCED_F_P2" == $2 || "FORCED_F_INH" == $2 || "FORCED_U_INH" == $2) {
CHK = "FAIL: event " $2 " inserted by DSP."
FORCE++
ERR++
}
if ("FIRST_P2" != $2 && "FIRST_P1" == TYPE) {
CHK = "FAIL: " TYPE " followed by " $2 " instead of P2."
ERR++
}
if ("FIRST" == $2 && "FIRST" == TYPE) {
CHK = "FAIL: multiple SID FIRST in a row."
ERR++
}
if ("OK" == CHK && "ONSET" != $2) { # check inter-SID distances:
if ("UPDATE" == TYPE) {
if (DELTA > U_MAX) {
CHK = "FAIL: delta (" $1 - FN "fn) from previous SID UPDATE (@" FN ") too big " DELTA "ms > " U_MAX "ms."
ERR++
}
if ("UPDATE" == $2 && DELTA < U_MIN) {
CHK = "FAIL: delta (" $1 - FN "fn) from previous SID UPDATE (@" FN ") too small " DELTA "ms < " U_MIN "ms."
ERR++
}
}
if ("FIRST" == TYPE) {
if (DELTA > F_MAX) {
CHK = "FAIL: delta (" $1 - FN "fn) from previous SID FIRST (@" FN ") too big " DELTA "ms > " F_MAX "ms."
ERR++
}
if ("UPDATE" == $2 && DELTA < F_MIN) {
CHK = "FAIL: delta (" $1 - FN "fn) from previous SID UPDATE (@" FN ") too small " DELTA "ms < " F_MIN "ms."
ERR++
}
}
}
if ("FACCH" == TYPE && "FIRST" != $2 && "FACCH" != $2 && 1 == SILENCE) { # check FACCH handling
CHK = "FAIL: incorrect silence resume with " $2 " after FACCH."
ERR++
}
}
if ("SPEECH" == $2 || "ONSET" == $2) { # talkspurt
SILENCE = 0
}
if ("UPDATE" == $2 || "FIRST" == $2) { # silence
SILENCE = 1
}
print $1, $2, CHK
if ($2 != "EMPTY") { # skip over EMPTY records
TYPE = $2
FN = $1
}
}
END {
print "Check completed: found " ERR " errors (" FORCE " events inserted by DSP) in " NR " records."
}

View File

@@ -10,7 +10,7 @@ env = os.environ
env['L1FWD_BTS_HOST'] = '127.0.0.1'
bts_proc = subprocess.Popen(["./src/osmo-bts-sysmo/sysmobts-remote",
"-c", "./doc/examples/osmo-bts.cfg"], env = env,
"-c", "./doc/examples/sysmo/osmo-bts-sysmo.cfg"], env = env,
stdin=None, stdout=None)
time.sleep(1)

91
contrib/eeprom_reader.c Normal file
View File

@@ -0,0 +1,91 @@
/* GPLv3+ to read sysmobts-v2 revD or later EEPROM from userspace */
#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <linux/i2c.h>
#include <linux/i2c-dev.h>
#include <sys/ioctl.h>
#include <errno.h>
#include <stdint.h>
#include <unistd.h>
#include <string.h>
/* Can read a 16bit at24 eeprom with 8192 byte in storage (24c64) */
static int dump_eeprom(int fd, int out)
{
#define STEP 8192
#define SIZE 8192
uint8_t buf[STEP + 2];
int rc = 0;
int i;
for (i = 0; i < SIZE; i += STEP) {
/* write the address */
buf[0] = i >> 8;
buf[1] = i;
rc = write(fd, buf, 2);
if (rc != 2) {
fprintf(stderr, "writing address failed: %d/%d/%s\n", rc, errno, strerror(errno));
return 1;
}
/* execute step amount of reads */
rc = read(fd, buf, STEP);
if (rc != STEP) {
fprintf(stderr, "Failed to read: %d/%d/%s\n", rc, errno, strerror(errno));
return 1;
}
write(out, buf, STEP);
}
return 0;
}
int main(int argc, char **argv)
{
int i2c_fd, out_fd;
char *filename = "/dev/i2c-1";
char *out_file = "eeprom.out";
int addr = 0x50;
int rc;
i2c_fd = open(filename, O_RDWR);
if (i2c_fd < 0) {
fprintf(stderr, "Failed to open i2c device %d/%d/%s\n",
i2c_fd, errno, strerror(errno));
return EXIT_FAILURE;
}
/* force using that address it is already bound with a driver */
rc = ioctl(i2c_fd, I2C_SLAVE_FORCE, addr);
if (rc < 0) {
fprintf(stderr, "Failed to claim i2c device %d/%d/%s\n",
rc, errno, strerror(errno));
return EXIT_FAILURE;
}
if (argc >= 2)
out_file = argv[1];
out_fd = open(out_file, O_WRONLY | O_CREAT | O_TRUNC, 0644);
if (out_fd < 0) {
fprintf(stderr, "Failed to open out device %s %d/%d/%s\n",
out_file, rc, errno, strerror(errno));
return EXIT_FAILURE;
}
if (dump_eeprom(i2c_fd, out_fd) != 0) {
unlink(out_file);
return EXIT_FAILURE;
}
return EXIT_SUCCESS;
}

57
contrib/jenkins_bts_model.sh Executable file
View File

@@ -0,0 +1,57 @@
#!/bin/sh
# jenkins build helper script for osmo-bts. This is how we build on jenkins.osmocom.org
#
# environment variables:
# * FIRMWARE_VERSION: which firmware version to build ("master", "femtobts_v2.7", ...)
# * WITH_MANUALS: build manual PDFs if set to "1"
# * PUBLISH: upload manuals after building if set to "1" (ignored without WITH_MANUALS = "1")
#
# usage: jenkins_bts_model.sh BTS_MODEL
# * BTS_MODEL: which BTS model specific script to run ("sysmo", "oct", ...)
#
bts_model="$1"
if [ "x$bts_model" = "x" ]; then
echo "Error: You have to specify the BTS model as first argument, e.g. $0 sysmo"
exit 2
fi
if [ ! -d "./contrib" ]; then
echo "Run ./contrib/jenkins_bts_model.sh from the root of the osmo-bts tree"
exit 1
fi
set -x -e
case "$bts_model" in
sysmo)
./contrib/jenkins_sysmobts.sh
;;
oct)
./contrib/jenkins_oct.sh
;;
lc15)
./contrib/jenkins_lc15.sh
;;
oc2g)
./contrib/jenkins_oc2g.sh
;;
trx)
./contrib/jenkins_bts_trx.sh
;;
oct+trx)
./contrib/jenkins_oct_and_bts_trx.sh
;;
*)
set +x
echo "Unknown BTS model '$bts_model'"
;;
esac

24
contrib/jenkins_bts_trx.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/sh
# jenkins build helper script for osmo-bts-trx
# shellcheck source=contrib/jenkins_common.sh
. $(dirname "$0")/jenkins_common.sh
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmocore "" --disable-doxygen
osmo-build-dep.sh libosmo-abis
cd "$deps"
configure_flags="\
--enable-sanitize \
--enable-werror \
--enable-trx \
"
build_bts "osmo-bts-trx" "$configure_flags"
osmo-clean-workspace.sh

62
contrib/jenkins_common.sh Normal file
View File

@@ -0,0 +1,62 @@
#!/bin/sh
# this is a common helper script that is shared among all BTS model
# specific helper scripts like jenkins_sysmobts.sh. You shouldn't call
# this directly, but rather indirectly via the bts-specific scripts
if ! [ -x "$(command -v osmo-deps.sh)" ]; then
echo "Error: We need to have scripts/osmo-deps.sh from http://git.osmocom.org/osmo-ci/ in PATH !"
exit 2
fi
set -ex
base="$PWD"
deps="$base/deps"
inst="$deps/install"
export deps inst
osmo-clean-workspace.sh
mkdir -p "$deps"
verify_value_string_arrays_are_terminated.py $(find . -name "*.[hc]")
# generic project build function, usage:
# build "PROJECT-NAME" "CONFIGURE OPTIONS"
build_bts() {
set +x
echo
echo
echo
echo " =============================== $1 ==============================="
echo
set -x
cd $deps
osmo-deps.sh libosmocore
cd $base
shift
# Manuals: build
conf_flags="$*"
if [ "$WITH_MANUALS" = "1" ]; then
conf_flags="$conf_flags --enable-manuals"
osmo-build-dep.sh osmo-gsm-manuals
export PATH="$inst/bin:$PATH"
fi
autoreconf --install --force
./configure $conf_flags
$MAKE $PARALLEL_MAKE
$MAKE check || cat-testlogs.sh
DISTCHECK_CONFIGURE_FLAGS="$conf_flags" $MAKE distcheck || cat-testlogs.sh
# Manuals: publish
if [ "$WITH_MANUALS" = "1" ] && [ "$PUBLISH" = "1" ]; then
$MAKE -C "$base/doc/manuals" publish
fi
$MAKE maintainer-clean
}

25
contrib/jenkins_lc15.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/sh
# jenkins build helper script for osmo-bts-lc15
# shellcheck source=contrib/jenkins_common.sh
. $(dirname "$0")/jenkins_common.sh
osmo-build-dep.sh libosmocore "" --disable-doxygen
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmo-abis
cd "$deps"
osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION"
configure_flags="\
--enable-sanitize \
--with-litecell15=$deps/layer1-headers/inc/ \
--enable-litecell15 \
"
build_bts "osmo-bts-lc15" "$configure_flags"
osmo-clean-workspace.sh

25
contrib/jenkins_oc2g.sh Executable file
View File

@@ -0,0 +1,25 @@
#!/bin/sh
# jenkins build helper script for osmo-bts-oc2g
# shellcheck source=contrib/jenkins_common.sh
. $(dirname "$0")/jenkins_common.sh
osmo-build-dep.sh libosmocore "" --disable-doxygen
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmo-abis
cd "$deps"
osmo-layer1-headers.sh oc2g "$FIRMWARE_VERSION"
configure_flags="\
--enable-sanitize \
--with-oc2g=$deps/layer1-headers/inc/ \
--enable-oc2g \
"
build_bts "osmo-bts-oc2g" "$configure_flags"
osmo-clean-workspace.sh

26
contrib/jenkins_oct.sh Executable file
View File

@@ -0,0 +1,26 @@
#!/bin/sh
# jenkins build helper script for osmo-bts-octphy
# shellcheck source=contrib/jenkins_common.sh
. $(dirname "$0")/jenkins_common.sh
osmo-build-dep.sh libosmocore "" --disable-doxygen
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmo-abis
cd "$deps"
osmo-layer1-headers.sh oct "$FIRMWARE_VERSION"
configure_flags="\
--enable-sanitize \
--enable-werror \
--with-octsdr-2g=$deps/layer1-headers/ \
--enable-octphy \
"
build_bts "osmo-bts-octphy" "$configure_flags"
osmo-clean-workspace.sh

View File

@@ -0,0 +1,27 @@
#!/bin/sh
# jenkins build helper script for osmo-bts-octphy + osmo-bts-trx
# shellcheck source=contrib/jenkins_common.sh
. $(dirname "$0")/jenkins_common.sh
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmocore "" --disable-doxygen
osmo-build-dep.sh libosmo-abis
cd "$deps"
osmo-layer1-headers.sh oct "$FIRMWARE_VERSION"
configure_flags="\
--enable-werror \
--with-octsdr-2g=$deps/layer1-headers/ \
--enable-octphy \
--enable-trx \
"
build_bts "osmo-bts-octphy+trx" "$configure_flags"
osmo-clean-workspace.sh

33
contrib/jenkins_sysmobts.sh Executable file
View File

@@ -0,0 +1,33 @@
#!/bin/sh
# jenkins build helper script for osmo-bts-sysmo
# shellcheck source=contrib/jenkins_common.sh
. $(dirname "$0")/jenkins_common.sh
osmo-build-dep.sh libosmocore "" --disable-doxygen
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmo-abis
cd "$deps"
osmo-layer1-headers.sh sysmo "$FIRMWARE_VERSION"
mkdir -p "$inst/include/sysmocom/femtobts"
ln -s $deps/layer1-headers/include/* "$inst/include/sysmocom/femtobts/"
configure_flags="\
--enable-sanitize \
--enable-werror \
--enable-sysmocom-bts \
--with-sysmobts=$inst/include/ \
"
# This will not work for the femtobts
if [ $FIRMWARE_VERSION != "femtobts_v2.7" ]; then
configure_flags="$configure_flags --enable-sysmobts-calib"
fi
build_bts "osmo-bts-sysmo" "$configure_flags"
osmo-clean-workspace.sh

View File

@@ -1,31 +0,0 @@
#!/bin/sh
### BEGIN INIT INFO
# Provides: l1fwd
# Required-Start:
# Required-Stop: $local_fs
# Default-Start: 5
# Default-Stop: 0 6
# Short-Description: Start screen session with l1fwd software
# Description:
### END INIT INFO
. /etc/default/rcS
case "$1" in
start)
/usr/bin/screen -d -m -c /etc/osmocom/screenrc-l1fwd
;;
stop)
echo "This script doesn't support stop"
exit 1
;;
restart|reload|force-reload)
exit 0
;;
show)
;;
*)
echo "Usage: sysmobts {start|stop|show|reload|restart}" >&2
exit 1
;;
esac

View File

@@ -1,13 +0,0 @@
#!/bin/sh
PID=$$
echo "-1000" > /proc/$PID/oom_score_adj
trap "{ kill 0; kill -2 0; }" EXIT
while [ -f $1 ]; do
(echo "0" > /proc/self/oom_score_adj && exec nice -n -20 $*) &
LAST_PID=$!
wait $LAST_PID
sleep 10s
done

View File

@@ -1,18 +0,0 @@
#!/bin/sh
PID=$$
echo "-1000" > /proc/$PID/oom_score_adj
trap "kill 0" EXIT
while [ -e /etc/passwd ]; do
cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0
sleep 2s
cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0
sleep 1s
echo "0" > /sys/class/leds/activity_led/brightness
(echo "0" > /proc/self/oom_score_adj && exec nice -n -20 $*) &
LAST_PID=$!
wait $LAST_PID
sleep 10s
done

View File

@@ -1,3 +0,0 @@
chdir /tmp
screen -t BTS 0 /etc/osmocom/respawn.sh /usr/bin/l1fwd-proxy
detach

View File

@@ -1,5 +0,0 @@
chdir /tmp
screen -t BTS 0 /etc/osmocom/respawn.sh /usr/bin/sysmobts -c /etc/osmocom/osmo-bts.cfg -r 1 -M
screen -t PCU 1 /etc/osmocom/respawn-only.sh /usr/bin/osmo-pcu -c /etc/osmocom/osmo-pcu.cfg -e
screen -t MGR 2 /etc/osmocom/respawn-only.sh /usr/bin/sysmobts-mgr -n -c /etc/osmocom/sysmobts-mgr.cfg
detach

91
contrib/si_check.gawk Executable file
View File

@@ -0,0 +1,91 @@
#!/usr/bin/gawk -f
# Usage example:
# tshark -2 -t r -E 'header=n' -E 'separator=,' -E 'quote=n' -T fields -e gsmtap.frame_nr -e gsmtap.ts -e gsmtap.arfcn -e _ws.col.Info -Y 'gsmtap' -r test.pcapng.gz | grep Information | env ARFCN=878 ./si_check.gawk
# read summary on number of bis/ter messages and adjust BT_BOTH and BT_NONE environment variables accordingly
BEGIN {
FS = ","
FAILED = 0
IGNORE = 0
BIS = 0
TER = 0
QUA = 0
BT_BOTH = ENVIRON["BOTH"]
BT_NONE = ENVIRON["NONE"]
TC_INDEX = 0
TC4[4] = 0
}
{ # expected .csv input as follows: gsmtap.frame_nr,gsmtap.ts,gsmtap.arfcn,_ws.col.Info
if ("ARFCN" in ENVIRON) { # ARFCN filtering is enabled
if (ENVIRON["ARFCN"] != $3) { # ignore other ARFCNs
IGNORE++
next
}
}
type = get_si_type($4)
tc = get_tc($1)
result = "FAIL"
if (1 == check_si_tc(tc, type)) { result = "OK" }
else { FAILED++ }
if (4 == tc) {
TC4[TC_INDEX] = type
TC_INDEX = int((TC_INDEX + 1) % 4)
if (0 == check_tc4c(type) && "OK" == result) {
result = "FAIL"
FAILED++
}
}
if (type == "2bis") { BIS++ }
if (type == "2ter") { TER++ }
if (type == "2quater") { QUA++ }
# for (i in TC4) print TC4[i] # debugging
printf "ARFCN=%d FN=%d TS=%d TC=%d TYPE=%s %s\n", $3, $1, $2, tc, type, result
}
END {
printf "check completed: total %d, failed %d, ignored %d, ok %d\nSI2bis = %d, SI2ter = %d, SI2quater = %d\n", NR, FAILED, IGNORE, NR - FAILED - IGNORE, BIS, TER, QUA
if ((BIS > 0 || TER > 0) && BT_NONE) { printf "please re-run with correct environment: unset 'NONE' variable\n" }
if ((BIS > 0 && TER > 0) && !BT_BOTH) { printf "please re-run with correct environment: set 'BOTH' variable\n" }
}
func get_si_type(s, x) { # we rely on format of Info column in wireshark output - if it's changed we're screwed
return x[split(s, x, " ")]
}
func get_tc(f) { # N. B: all numbers in awk are float
return int(int(f / 51) % 8)
}
func check_tc4c(si, count) { # check for "once in 4 consecutive occurrences" rule
count = 0
if ("2quater" != si || "2ter" != si) { return 1 } # rules is not applicable to other types
if (BT_NONE && "2quater" == si) { return 0 } # should be on TC=5 instead
if (!BT_BOTH && "2ter" == si) { return 0 } # should be on TC=5 instead
if (0 in TC4 && 1 in TC4 && 2 in TC4 && 3 in TC4) { # only check if we have 4 consecutive occurrences already
if (si == TC4[0]) { count++ }
if (si == TC4[1]) { count++ }
if (si == TC4[2]) { count++ }
if (si == TC4[3]) { count++ }
if (0 == count) { return 0 }
}
return 1
}
func check_si_tc(tc, si) { # check that SI scheduling on BCCH Norm is matching rules from 3GPP TS 05.02 § 6.3.1.3
switch (si) {
case "1": return (0 == tc) ? 1 : 0
case "2": return (1 == tc) ? 1 : 0
case "2bis": return (5 == tc) ? 1 : 0
case "13": return (4 == tc) ? 1 : 0
case "9": return (4 == tc) ? 1 : 0
case "2ter": if (BT_BOTH) { return (4 == tc) ? 1 : 0 } else { return (5 == tc) ? 1 : 0 }
case "2quater": if (BT_NONE) { return (5 == tc) ? 1 : 0 } else { return (4 == tc) ? 1 : 0 }
case "3": return (2 == tc || 6 == tc) ? 1 : 0
case "4": return (3 == tc || 7 == tc) ? 1 : 0
}
return 0
}

110
contrib/superfemto.sh Executable file
View File

@@ -0,0 +1,110 @@
#!/bin/sh
# Split common DSP call log file (produced by superfemto-compatible firmware) into 4 separate call leg files (MO/MT & DL/UL) with events in format "FN EVENT_TYPE":
# MO Mobile Originated
# MT Mobile Terminated
# DL DownLink (BTS -> L1)
# UL UpLink (L1 -> BTS)
if [ -z $1 ]; then
echo "expecting DSP log file name as parameter"
exit 1
fi
# MO handle appear 1st in the logs
MO=$(grep 'h=' $1 | head -n 1 | cut -f2 -d',' | cut -f2 -d= | cut -f1 -d']')
# direction markers:
DLST="_CodeBurst"
ULST="_DecodeAndIdentify"
# DL sed filters:
D_EMP='s/ Empty frame request!/EMPTY/i'
D_FAC='s/ Coding a FACCH\/. frame !!/FACCH/i'
D_FST='s/ Coding a RTP SID First frame !!/FIRST/i'
D_FS1='s/ Coding a SID First P1 frame !!/FIRST_P1/i'
D_FS2='s/ Coding a SID First P2 frame !!/FIRST_P2/i'
D_RP1='s/ Coding a RTP SID P1 frame !!/SID_P1/i'
D_UPD='s/ Coding a RTP SID Update frame !!/UPDATE/i'
D_SPE='s/ Coding a RTP Speech frame !!/SPEECH/i'
D_ONS='s/ Coding a Onset frame !!/ONSET/i'
D_FO1='s/ A speech frame is following a NoData or SID First without an Onset./FORCED_FIRST/i'
D_FO2='s/ A speech frame is following a NoData without an Onset./FORCED_NODATA/i'
D_FP2='s/ A speech frame is following a NoData or SID_FIRST_P2 without an Onset./FORCED_F_P2/i'
D_FIN='s/ A speech frame is following a SID_FIRST without inhibit. A SID_FIRST_INH will be inserted./FORCED_F_INH/i'
D_UIN='s/ A speech frame is following a SID_UPDATE without inhibit. A SID_UPDATE_INH will be inserted./FORCED_U_INH/i'
# UL sed filters:
U_NOD='s/ It is a No Data frame !!/NODATA/i'
U_ONS='s/ It is an ONSET frame !!/ONSET/i'
U_UPD='s/ It is a SID UPDATE frame !!/UPDATE/i'
U_FST='s/ It is a SID FIRST frame !!/FIRST/i'
U_FP1='s/ It is a SID-First P1 frame !!/FIRST_P1/i'
U_FP2='s/ It is a SID-First P2 frame !!/FIRST_P2/i'
U_SPE='s/ It is a SPEECH frame *!!/SPEECH/i'
U_UIN='s/ It is a SID update InH frame !!/UPD_INH/i'
U_FIN='s/ It is a SID-First InH frame !!/FST_INH/i'
U_RAT='s/ It is a RATSCCH data frame !!/RATSCCH/i'
DL () { # filter downlink-related entries
grep $DLST $1 > $1.DL.tmp
}
UL () { # uplink does not require special fix
grep $ULST $1 > $1.UL.tmp.fix
}
DL $1
UL $1
FIX() { # add MO/MT marker from preceding line to inserted ONSETs so filtering works as expected
cat $1.DL.tmp | awk 'BEGIN{ FS=" h="; H="" } { if (NF > 1) { H = $2; print $1 "h=" $2 } else { print $1 ", h=" H } }' > $1.DL.tmp.fix
}
FIX $1
MO() { # filter MO call DL or UL logs
grep "h=$MO" $1.tmp.fix > $1.MO.raw
}
MT() { # filter MT call DL or UL logs
grep -v "h=$MO" $1.tmp.fix > $1.MT.raw
}
MO $1.DL
MT $1.DL
MO $1.UL
MT $1.UL
PREP() { # prepare logs for reformatting
cat $1.raw | cut -f2 -d')' | cut -f1 -d',' | cut -f2 -d'>' | sed 's/\[u32Fn/fn/' | sed 's/\[ u32Fn/fn/' | sed 's/fn = /fn=/' | sed 's/fn=//' | sed 's/\[Fn=//' | sed 's/ An Onset will be inserted.//' > $1.tmp1
}
PREP "$1.DL.MT"
PREP "$1.DL.MO"
PREP "$1.UL.MT"
PREP "$1.UL.MO"
RD() { # reformat DL logs for consistency checks
cat $1.tmp1 | sed "$D_FST" | sed "$D_SPE" | sed "$D_FS1" | sed "$D_FS2" | sed "$D_UIN" | sed "$D_FIN" | sed "$D_UPD" | sed "$D_INH" | sed "$D_RP1" | sed "$D_ONS" | sed "$D_EMP" | sed "$D_FAC" | sed "$D_FO1" | sed "$D_FO2" | sed "$D_FP2" > $1.tmp2
}
RU() { # reformat UL logs for consistency checks
cat $1.tmp1 | sed "$U_FST" | sed "$U_SPE" | sed "$U_FP1" | sed "$U_FP2" | sed "$U_UPD" | sed "$U_ONS" | sed "$U_NOD" | sed "$U_UIN" | sed "$U_FIN" | sed "$U_RAT" > $1.tmp2
}
RD "$1.DL.MT"
RD "$1.DL.MO"
RU "$1.UL.MT"
RU "$1.UL.MO"
SW() { # swap fields
cat $1.tmp2 | awk '{ print $2, $1 }' > $1
}
SW "$1.DL.MT"
SW "$1.DL.MO"
SW "$1.UL.MT"
SW "$1.UL.MO"
rm $1.*.tmp*

View File

@@ -1,10 +0,0 @@
CFLAGS=`pkg-config --cflags libosmocore` -Wall -Werror
LIBS=`pkg-config --libs libosmocore libosmogsm`
all: sysmobts-calib
sysmobts-calib: sysmobts-calib.o sysmobts-layer1.o
$(CC) $(CPPFLAGS) $(LDFLAGS) -o $@ $^ -lrt $(LIBS)
clean:
@rm -f sysmobts-calib *.o

View File

@@ -0,0 +1,32 @@
EXTRA_DIST = \
lc15bts-mgr.service \
oc2gbts-mgr.service \
osmo-bts-lc15.service \
osmo-bts-oc2g.service \
osmo-bts-sysmo.service \
osmo-bts-trx.service \
osmo-bts-virtual.service \
sysmobts-mgr.service
if HAVE_SYSTEMD
SYSTEMD_SERVICES = osmo-bts-virtual.service
if ENABLE_SYSMOBTS
SYSTEMD_SERVICES += osmo-bts-sysmo.service sysmobts-mgr.service
endif
if ENABLE_TRX
SYSTEMD_SERVICES += osmo-bts-trx.service
endif
if ENABLE_LC15BTS
SYSTEMD_SERVICES += osmo-bts-lc15.service lc15bts-mgr.service
endif
if ENABLE_OC2GBTS
SYSTEMD_SERVICES += osmo-bts-oc2g.service oc2gbts-mgr.service
endif
systemdsystemunit_DATA = $(SYSTEMD_SERVICES)
endif # HAVE_SYSTEMD

View File

@@ -0,0 +1,29 @@
[Unit]
Description=osmo-bts manager for LC15 / sysmoBTS 2100
After=lc15-sysdev-remap.service
Wants=lc15-sysdev-remap.service
[Service]
Type=simple
NotifyAccess=all
WatchdogSec=21780s
Restart=always
RestartSec=2
# Make sure directories and symbolic link exist
ExecStartPre=/bin/sh -c 'test -d /mnt/storage/var/run/lc15bts-mgr || mkdir -p /mnt/storage/var/run/lc15bts-mgr ; test -d /var/run/lc15bts-mgr || ln -sf /mnt/storage/var/run/lc15bts-mgr/ /var/run'
# Make sure BTS operation hour exist
ExecStartPre=/bin/sh -c 'test -f /mnt/storage/var/run/lc15bts-mgr/hours-running || echo 0 > /mnt/storage/var/run/lc15bts-mgr/hours-running'
# Shutdown all PA correctly
ExecStartPre=/bin/sh -c 'echo disabled > /var/lc15/pa-state/pa0/state; echo disabled > /var/lc15/pa-state/pa1/state'
ExecStartPre=/bin/sh -c 'echo 0 > /var/lc15/pa-supply/max_microvolts; echo 0 > /var/lc15/pa-supply/min_microvolts'
ExecStart=/usr/bin/lc15bts-mgr -s -c /etc/osmocom/lc15bts-mgr.cfg
# Shutdown all PA correctly
ExecStopPost=/bin/sh -c 'echo disabled > /var/lc15/pa-state/pa0/state; echo disabled > /var/lc15/pa-state/pa1/state'
ExecStopPost=/bin/sh -c 'echo 0 > /var/lc15/pa-supply/max_microvolts; echo 0 > /var/lc15/pa-supply/min_microvolts'
[Install]
WantedBy=multi-user.target
Alias=osmo-bts-mgr.service

View File

@@ -0,0 +1,29 @@
[Unit]
Description=osmo-bts manager for OC-2G
After=oc2g-sysdev-remap.service
Wants=oc2g-sysdev-remap.service
[Service]
Type=simple
NotifyAccess=all
WatchdogSec=21780s
Restart=always
RestartSec=2
# Make sure directories and symbolic link exist
ExecStartPre=/bin/sh -c 'test -d /mnt/storage/var/run/oc2gbts-mgr || mkdir -p /mnt/storage/var/run/oc2gbts-mgr ; test -d /var/run/oc2gbts-mgr || ln -sf /mnt/storage/var/run/oc2gbts-mgr/ /var/run'
# Make sure BTS operation hour exist
ExecStartPre=/bin/sh -c 'test -f /mnt/storage/var/run/oc2gbts-mgr/hours-running || echo 0 > /mnt/storage/var/run/oc2gbts-mgr/hours-running'
# Shutdown all PA correctly
ExecStartPre=/bin/sh -c 'echo disabled > /var/oc2g/pa-state/pa0/state;'
#ExecStartPre=/bin/sh -c 'echo 0 > /var/oc2g/pa-supply/max_microvolts; echo 0 > /var/oc2g/pa-supply/min_microvolts'
ExecStart=/usr/bin/oc2gbts-mgr -s -c /etc/osmocom/oc2gbts-mgr.cfg
# Shutdown all PA correctly
ExecStopPost=/bin/sh -c 'echo disabled > /var/oc2g/pa-state/pa0/state;'
#ExecStopPost=/bin/sh -c 'echo 0 > /var/oc2g/pa-supply/max_microvolts; echo 0 > /var/oc2g/pa-supply/min_microvolts'
[Install]
WantedBy=multi-user.target
Alias=osmo-bts-mgr.service

View File

@@ -0,0 +1,18 @@
[Unit]
Description=osmo-bts for LC15 / sysmoBTS 2100
[Service]
Type=simple
ExecStart=/usr/bin/osmo-bts-lc15 -t 2 -s -c /etc/osmocom/osmo-bts-lc15.cfg -M
RuntimeDirectory=osmo-bts
Restart=always
RestartSec=2
RestartPreventExitStatus=1
# The msg queues must be read fast enough
CPUSchedulingPolicy=rr
CPUSchedulingPriority=1
[Install]
WantedBy=multi-user.target
Alias=osmo-bts.service

View File

@@ -0,0 +1,18 @@
[Unit]
Description=osmo-bts for OC-2G
[Service]
Type=simple
ExecStart=/usr/bin/osmo-bts-oc2g -s -c /etc/osmocom/osmo-bts-oc2g.cfg -M
RuntimeDirectory=osmo-bts
Restart=always
RestartSec=2
RestartPreventExitStatus=1
# The msg queues must be read fast enough
CPUSchedulingPolicy=rr
CPUSchedulingPriority=1
[Install]
WantedBy=multi-user.target
Alias=osmo-bts.service

View File

@@ -1,10 +1,10 @@
[Unit]
Description=sysmocom sysmoBTS
Description=osmo-bts for sysmocom sysmoBTS
[Service]
Type=simple
ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness'
ExecStart=/usr/bin/sysmobts -s -c /etc/osmocom/osmo-bts.cfg -M
ExecStart=/usr/bin/osmo-bts-sysmo -s -c /etc/osmocom/osmo-bts-sysmo.cfg -M
ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness'
ExecStopPost=/bin/sh -c 'cat /lib/firmware/sysmobts-v?.bit > /dev/fpgadl_par0 ; sleep 3s; cat /lib/firmware/sysmobts-v?.out > /dev/dspdl_dm644x_0; sleep 1s'
Restart=always
@@ -17,3 +17,5 @@ CPUSchedulingPriority=1
[Install]
WantedBy=multi-user.target
Alias=sysmobts.service
Alias=osmo-bts.service

View File

@@ -0,0 +1,15 @@
[Unit]
Description=Osmocom osmo-bts for osmo-trx
[Service]
Type=simple
ExecStart=/usr/bin/osmo-bts-trx -s -c /etc/osmocom/osmo-bts-trx.cfg
Restart=always
RestartSec=2
# Let it process messages quickly enough
CPUSchedulingPolicy=rr
CPUSchedulingPriority=1
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,15 @@
[Unit]
Description=Osmocom GSM BTS for virtual Um layer based on GSMTAP/UDP
[Service]
Type=simple
ExecStart=/usr/bin/osmo-bts-virtual -s -c /etc/osmocom/osmo-bts-virtual.cfg
Restart=always
RestartSec=2
# Let it process messages quickly enough
CPUSchedulingPolicy=rr
CPUSchedulingPriority=1
[Install]
WantedBy=multi-user.target

View File

@@ -1,5 +1,5 @@
[Unit]
Description=sysmocom sysmoBTS manager
Description=osmo-bts manager for sysmoBTS
[Service]
Type=simple
@@ -9,4 +9,4 @@ RestartSec=2
[Install]
WantedBy=multi-user.target
Alias=osmo-bts-mgr.service

1293
debian/changelog vendored Normal file

File diff suppressed because it is too large Load Diff

1
debian/compat vendored Normal file
View File

@@ -0,0 +1 @@
9

60
debian/control vendored Normal file
View File

@@ -0,0 +1,60 @@
Source: osmo-bts
Maintainer: Holger Hans Peter Freyther <holger@moiji-mobile.com>
Section: net
Priority: optional
Build-Depends: debhelper (>= 9),
pkg-config,
dh-autoreconf,
dh-systemd (>= 1.5),
autotools-dev,
pkg-config,
libosmocore-dev,
libosmo-abis-dev,
libgps-dev,
txt2man,
osmo-gsm-manuals-dev
Standards-Version: 3.9.8
Vcs-Browser: http://git.osmocom.org/osmo-bts/
Vcs-Git: git://git.osmocom.org/osmo-bts
Homepage: https://projects.osmocom.org/projects/osmobts
Package: osmo-bts-trx
Architecture: any
Conflicts: osmo-bts
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: osmo-bts-trx GSM BTS with osmo-trx
osmo-bts-trx to be used with the osmo-trx application
Package: osmo-bts-trx-dbg
Architecture: any
Section: debug
Priority: extra
Depends: osmo-bts-trx (= ${binary:Version}), ${misc:Depends}
Description: Debug symbols for the osmo-bts-trx
Make debugging possible
Package: osmo-bts-virtual
Architecture: any
Conflicts: osmo-bts
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: Virtual Osmocom GSM BTS (no RF hardware; GSMTAP/UDP)
This version of OsmoBTS doesn't use actual GSM PHY/Hardware/RF, but
utilizes GSMTAP-over-UDP frames for the Um interface. This is useful
in fully virtualized setups e.g. in combination with OsmocomBB virt_phy.
Package: osmo-bts-virtual-dbg
Architecture: any
Section: debug
Priority: extra
Depends: osmo-bts-virtual (= ${binary:Version}), ${misc:Depends}
Description: Debug symbols for the osmo-bts-virtual
Make debugging possible
Package: osmo-bts-doc
Architecture: all
Section: doc
Priority: optional
Depends: ${misc:Depends}
Description: ${misc:Package} PDF documentation
Various manuals: user manual, VTY reference manual and/or
protocol/interface manuals.

81
debian/copyright vendored Normal file
View File

@@ -0,0 +1,81 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: osmo-bts
Source: http://cgit.osmocom.org/osmo-bts/
Files: *
Copyright: 2008-2014 Harald Welte <laforge@gnumonks.org>
2009,2011,2013 Andreas Eversberg <jolly@eversberg.eu>
2010,2011 On-Waves
2012-2015 Holger Hans Peter Freyther
2014 sysmocom s.f.m.c. Gmbh
2015 Alexander Chemeris <Alexander.Chemeris@fairwaves.co>
License: AGPL-3+
Files: src/osmo-bts-sysmo/eeprom.c
src/osmo-bts-sysmo/eeprom.h
Copyright: 2012 Nutaq
License: MIT
Comment: Yves Godin is the author
Files: src/common/pcu_sock.c
Copyright: 2008-2010 Harald Welte <laforge@gnumonks.org>
2009-2012 Andreas Eversberg <jolly@eversberg.eu>
2012 Holger Hans Peter Freyther
License: GPL-2+
Files: debian/*
Copyright: 2015-2016 Ruben Undheim <ruben.undheim@gmail.com>
License: AGPL-3+
License: AGPL-3+
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU Affero General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
License: GPL-2+
This package is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
.
On Debian systems, the complete text of the GNU General
Public License version 2 can be found in "/usr/share/common-licenses/GPL-2".
License: MIT
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
of the Software, and to permit persons to whom the Software is furnished to do
so, subject to the following conditions:
.
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

1
debian/osmo-bts-doc.install vendored Normal file
View File

@@ -0,0 +1 @@
usr/share/doc/osmo-bts-doc/*.pdf

5
debian/osmo-bts-trx.install vendored Normal file
View File

@@ -0,0 +1,5 @@
etc/osmocom/osmo-bts-trx.cfg
lib/systemd/system/osmo-bts-trx.service
usr/bin/osmo-bts-trx
usr/share/doc/osmo-bts/examples/osmo-bts-trx/osmo-bts-trx.cfg
usr/share/doc/osmo-bts/examples/osmo-bts-trx/osmo-bts-trx-calypso.cfg

6
debian/osmo-bts-virtual.install vendored Normal file
View File

@@ -0,0 +1,6 @@
etc/osmocom/osmo-bts-virtual.cfg
lib/systemd/system/osmo-bts-virtual.service
usr/bin/osmo-bts-virtual
usr/bin/osmo-bts-omldummy
usr/share/doc/osmo-bts/examples/osmo-bts-virtual/osmo-bts-virtual.cfg
usr/share/doc/osmo-bts/examples/osmo-bts-virtual/openbsc-virtual.cfg

32
debian/rules vendored Executable file
View File

@@ -0,0 +1,32 @@
#!/usr/bin/make -f
DEBIAN := $(shell dpkg-parsechangelog | grep ^Version: | cut -d' ' -f2)
DEBVERS := $(shell echo '$(DEBIAN)' | cut -d- -f1)
VERSION := $(shell echo '$(DEBVERS)' | sed -e 's/[+-].*//' -e 's/~//g')
#export DH_VERBOSE=1
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
%:
dh $@ --with=systemd --with autoreconf --fail-missing
override_dh_strip:
dh_strip --package=osmo-bts-virtual --dbg-package=osmo-bts-virtual-dbg
dh_strip --package=osmo-bts-trx --dbg-package=osmo-bts-trx-dbg
override_dh_auto_configure:
dh_auto_configure -- --enable-trx --with-systemdsystemunitdir=/lib/systemd/system --enable-manuals
override_dh_clean:
dh_clean
$(RM) tests/package.m4
$(RM) tests/testsuite
# Print test results in case of a failure
override_dh_auto_test:
dh_auto_test || (find . -name testsuite.log -exec cat {} \; ; false)
# Don't create .pdf.gz files (barely saves space and they can't be opened directly by most pdf readers)
override_dh_compress:
dh_compress -X.pdf

1
debian/source/format vendored Normal file
View File

@@ -0,0 +1 @@
3.0 (native)

4
doc/Makefile.am Normal file
View File

@@ -0,0 +1,4 @@
SUBDIRS = \
examples \
manuals \
$(NULL)

View File

@@ -4,7 +4,7 @@ h2. generic
h3. trx.0.thermal-attenuation
The idea of this paramter is to attenuate the system output power as part of
The idea of this parameter is to attenuate the system output power as part of
thermal management. In some cases the PA might be passing a critical level,
so an external control process can use this attribute to reduce the system
output power.

55
doc/examples/Makefile.am Normal file
View File

@@ -0,0 +1,55 @@
OSMOCONF_FILES = virtual/osmo-bts-virtual.cfg
doc_virtualdir = $(docdir)/examples/osmo-bts-virtual
doc_virtual_DATA = \
virtual/osmo-bts-virtual.cfg \
virtual/openbsc-virtual.cfg
EXTRA_DIST = $(doc_virtual_DATA)
if ENABLE_SYSMOBTS
doc_sysmodir = $(docdir)/examples/osmo-bts-sysmo
doc_sysmo_DATA = \
sysmo/osmo-bts-sysmo.cfg \
sysmo/sysmobts-mgr.cfg
EXTRA_DIST += $(doc_sysmo_DATA)
OSMOCONF_FILES += sysmo/osmo-bts-sysmo.cfg sysmo/sysmobts-mgr.cfg
endif
if ENABLE_TRX
doc_trxdir = $(docdir)/examples/osmo-bts-trx
doc_trx_DATA = \
trx/osmo-bts-trx.cfg \
trx/osmo-bts-trx-calypso.cfg
EXTRA_DIST += $(doc_trx_DATA)
OSMOCONF_FILES += trx/osmo-bts-trx.cfg
endif
if ENABLE_OCTPHY
doc_octphydir = $(docdir)/examples/osmo-bts-octphy
doc_octphy_DATA = \
octphy/osmo-bts-trx2dsp1.cfg \
octphy/osmo-bts-octphy.cfg
EXTRA_DIST += $(doc_octphy_DATA)
OSMOCONF_FILES += octphy/osmo-bts-octphy.cfg
endif
if ENABLE_LC15BTS
doc_lc15dir = $(docdir)/examples/osmo-bts-lc15
doc_lc15_DATA = \
litecell15/osmo-bts-lc15.cfg \
litecell15/lc15bts-mgr.cfg
EXTRA_DIST += $(doc_lc15_DATA)
OSMOCONF_FILES += litecell15/osmo-bts-lc15.cfg litecell15/lc15bts-mgr.cfg
endif
if ENABLE_OC2GBTS
doc_oc2gdir = $(docdir)/examples/osmo-bts-oc2g
doc_oc2g_DATA = \
oc2g/osmo-bts-oc2g.cfg \
oc2g/oc2gbts-mgr.cfg
EXTRA_DIST += $(doc_oc2g_DATA)
OSMOCONF_FILES += oc2g/osmo-bts-oc2g.cfg oc2g/oc2gbts-mgr.cfg
endif
osmoconfdir = $(sysconfdir)/osmocom
osmoconf_DATA = $(OSMOCONF_FILES)

View File

@@ -0,0 +1,43 @@
!
! lc15bts-mgr (0.3.0.284-a7c2-dirty) configuration saved from vty
!!
!
log stderr
logging filter all 1
logging color 1
logging print category 0
logging timestamp 0
logging level temp info
logging level fw info
logging level find info
logging level calib info
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp notice
!
line vty
no login
!
lc15bts-mgr
limits supply_volt
threshold warning min 17500
threshold critical min 19000
limits tx0_vswr
threshold warning max 1000
limits tx1_vswr
threshold warning max 1000
limits supply_pwr
threshold warning max 110
threshold critical max 120
limits pa0_pwr
threshold warning max 50
threshold critical max 60
limits pa1_pwr
threshold warning max 50
threshold critical max 60

View File

@@ -0,0 +1,43 @@
!
! OsmoBTS (0.0.1.100-0455-dirty) configuration saved from vty
!!
!
log stderr
logging color 1
logging timestamp 0
logging level rsl info
logging level oml info
logging level rll notice
logging level rr notice
logging level meas notice
logging level pag info
logging level l1c info
logging level l1p info
logging level dsp debug
logging level abis notice
logging level rtp notice
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
!
line vty
no login
!
phy 0
instance 0
trx-calibration-path /mnt/rom/factory/calib
phy 1
instance 0
trx-calibration-path /mnt/rom/factory/calib
bts 0
band 900
ipa unit-id 1500 0
oml remote-ip 192.168.234.185
trx 0
phy 0 instance 0
trx 1
phy 1 instance 0

View File

@@ -1,15 +1,16 @@
!
! SysmoMgr (0.3.0.141-33e5) configuration saved from vty
! oc2gbts-mgr (0.3.0.284-a7c2-dirty) configuration saved from vty
!!
!
log stderr
logging filter all 1
logging color 1
logging print category 0
logging timestamp 0
logging level all everything
logging level temp info
logging level fw info
logging level find info
logging level calib info
logging level lglobal notice
logging level llapd notice
logging level linp notice
@@ -17,8 +18,16 @@ log stderr
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp notice
!
line vty
no login
!
sysmobts-mgr
oc2gbts-mgr
limits supply_volt
threshold warning min 17500
threshold critical min 19000
limits supply_pwr
threshold warning max 110
threshold critical max 120

View File

@@ -0,0 +1,38 @@
!
! OsmoBTS (0.0.1.100-0455-dirty) configuration saved from vty
!!
!
log stderr
logging color 1
logging timestamp 0
logging level rsl info
logging level oml info
logging level rll notice
logging level rr notice
logging level meas notice
logging level pag info
logging level l1c info
logging level l1p info
logging level dsp debug
logging level abis notice
logging level rtp notice
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
!
line vty
no login
!
phy 0
instance 0
trx-calibration-path /mnt/rom/factory/calib
bts 0
band 900
ipa unit-id 1500 0
oml remote-ip 10.42.0.1
trx 0
phy 0 instance 0

View File

@@ -0,0 +1,31 @@
!
! OsmoBTS () configuration saved from vty
!!
!
log stderr
logging color 1
logging timestamp 0
logging level rsl info
logging level oml info
logging level rll notice
logging level rr notice
logging level meas notice
logging level pag info
logging level l1c info
logging level l1p info
logging level dsp info
logging level abis notice
!
line vty
no login
!
phy 0
octphy hw-addr 00:0C:90:2e:80:1e
octphy net-device eth0.2342
instance 0
bts 0
band 1800
ipa unit-id 1234 0
oml remote-ip 127.0.0.1
trx 0
phy 0 instance 0

View File

@@ -0,0 +1,34 @@
!
! OsmoBTS () configuration saved from vty
!!
!
log stderr
logging color 1
logging timestamp 0
logging level rsl info
logging level oml info
logging level rll notice
logging level rr notice
logging level meas notice
logging level pag info
logging level l1c info
logging level l1p info
logging level dsp info
logging level abis notice
!
line vty
no login
!
phy 0
octphy hw-addr 00:0c:de:ad:fa:ce
octphy net-device eth2
instance 0
instance 1
bts 0
band 1800
ipa unit-id 1234 0
oml remote-ip 127.0.0.1
trx 0
phy 0 instance 0
trx 1
phy 0 instance 1

View File

@@ -1,26 +0,0 @@
!
! OsmoBTS () configuration saved from vty
!!
!
log stderr
logging color 0
logging timestamp 0
logging level all everything
logging level rsl info
logging level oml info
logging level rll notice
logging level rr notice
logging level meas notice
logging level pag info
logging level l1c info
logging level l1p info
logging level dsp debug
logging level abis notice
!
line vty
no login
!
bts 0
band 1800
ipa unit-id 1234 0
oml remote-ip 192.168.100.11

View File

@@ -0,0 +1,29 @@
!
! OsmoBTS () configuration saved from vty
!!
!
log stderr
logging color 1
logging timestamp 0
logging level rsl info
logging level oml info
logging level rll notice
logging level rr notice
logging level meas notice
logging level pag info
logging level l1c info
logging level l1p info
logging level dsp info
logging level abis notice
!
line vty
no login
!
phy 0
instance 0
bts 0
band 1800
ipa unit-id 666 0
oml remote-ip 10.1.2.3
trx 0
phy 0 instance 0

View File

@@ -0,0 +1,23 @@
!
! SysmoMgr (0.3.0.141-33e5) configuration saved from vty
!!
!
log stderr
logging filter all 1
logging color 1
logging timestamp 0
logging level temp info
logging level fw info
logging level find info
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
!
line vty
no login
!
sysmobts-mgr

View File

@@ -0,0 +1,38 @@
!
! OsmoBTS configuration example for CalypsoBTS
! http://osmocom.org/projects/baseband/wiki/CalypsoBTS
!!
!
log stderr
logging color 1
logging timestamp 0
logging level rsl notice
logging level oml notice
logging level rll notice
logging level rr notice
logging level meas error
logging level pag error
logging level l1c error
logging level l1p error
logging level dsp error
logging level abis error
!
line vty
no login
!
phy 0
instance 0
osmotrx rx-gain 1
osmotrx ip local 127.0.0.1
osmotrx ip remote 127.0.0.1
osmotrx timing-advance-loop
osmotrx ms-power-loop -65
osmotrx legacy-setbsic
bts 0
oml remote-ip 127.0.0.1
ipa unit-id 1801 0
gsmtap-sapi pdtch
gsmtap-sapi ccch
band 900
trx 0
phy 0 instance 0

View File

@@ -0,0 +1,34 @@
!
! OsmoBTS () configuration saved from vty
!!
!
log stderr
logging color 1
logging timestamp 0
logging level rsl notice
logging level oml notice
logging level rll notice
logging level rr notice
logging level meas error
logging level pag error
logging level l1c error
logging level l1p error
logging level dsp error
logging level abis error
!
line vty
no login
!
phy 0
instance 0
osmotrx rx-gain 1
osmotrx ip local 127.0.0.1
osmotrx ip remote 127.0.0.1
bts 0
band 1800
ipa unit-id 6969 0
oml remote-ip 192.168.122.1
gsmtap-sapi ccch
gsmtap-sapi pdtch
trx 0
phy 0 instance 0

View File

@@ -0,0 +1,151 @@
!
! OpenBSC (0.15.0.629-34f0-dirty) configuration saved from vty
!!
!
log stderr
logging filter all 1
logging color 0
logging print category 1
logging timestamp 1
logging level all info
logging level rll notice
logging level cc notice
logging level mm debug
logging level rr notice
logging level rsl notice
logging level nm info
logging level mncc notice
logging level pag notice
logging level meas notice
logging level sccp notice
logging level msc notice
logging level mgcp notice
logging level ho notice
logging level db notice
logging level ref notice
logging level gprs debug
logging level ns info
logging level bssgp debug
logging level llc debug
logging level sndcp debug
logging level nat notice
logging level ctrl notice
logging level smpp debug
logging level filter debug
logging level ranap debug
logging level sua debug
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp notice
logging level lstats notice
logging level lgsup notice
logging level loap notice
!
stats interval 5
!
line vty
no login
!
e1_input
e1_line 0 driver ipa
e1_line 0 port 0
no e1_line 0 keepalive
network
network country code 262
mobile network code 42
short name OpenBSC
long name OpenBSC
auth policy accept-all
authorized-regexp .*
location updating reject cause 13
encryption a5 0
neci 1
paging any use tch 0
rrlp mode ms-based
mm info 1
handover 0
handover window rxlev averaging 10
handover window rxqual averaging 1
handover window rxlev neighbor averaging 10
handover power budget interval 6
handover power budget hysteresis 3
handover maximum distance 9999
timer t3101 10
timer t3103 0
timer t3105 0
timer t3107 0
timer t3109 4
timer t3111 0
timer t3113 60
timer t3115 0
timer t3117 0
timer t3119 0
timer t3122 10
timer t3141 0
subscriber-keep-in-ram 0
bts 0
type sysmobts
band DCS1800
cell_identity 6969
location_area_code 1
base_station_id_code 63
ms max power 0
cell reselection hysteresis 4
rxlev access min 0
periodic location update 30
radio-link-timeout 32
channel allocator descending
rach tx integer 9
rach max transmission 7
channel-descrption attach 1
channel-descrption bs-pa-mfrms 5
channel-descrption bs-ag-blks-res 1
ip.access unit_id 6969 0
oml ip.access stream_id 255 line 0
neighbor-list mode automatic
codec-support fr
gprs mode none
no force-combined-si
trx 0
rf_locked 0
arfcn 666
nominal power 0
max_power_red 0
rsl e1 tei 0
timeslot 0
phys_chan_config CCCH+SDCCH4
hopping enabled 0
timeslot 1
phys_chan_config SDCCH8
hopping enabled 0
timeslot 2
phys_chan_config TCH/F
hopping enabled 0
timeslot 3
phys_chan_config TCH/F
hopping enabled 0
timeslot 4
phys_chan_config TCH/F
hopping enabled 0
timeslot 5
phys_chan_config TCH/F
hopping enabled 0
timeslot 6
phys_chan_config TCH/F
hopping enabled 0
timeslot 7
phys_chan_config TCH/F
hopping enabled 0
mncc-int
default-codec tch-f fr
default-codec tch-h hr
nitb
subscriber-create-on-demand
subscriber-create-on-demand random 1 24
assign-tmsi

View File

@@ -0,0 +1,61 @@
!
! OsmoBTS (0.4.0.216-bc49-dirty) configuration saved from vty
!!
!
log stderr
logging filter all 0
logging color 0
logging print category 1
logging timestamp 0
logging level rsl info
logging level oml info
logging level rll notice
logging level rr notice
logging level meas notice
logging level pag info
logging level l1c info
logging level l1p info
logging level dsp error
logging level pcu notice
logging level ho debug
logging level trx notice
logging level loop notice
logging level abis debug
logging level rtp notice
logging level sum error
logging level lglobal notice
logging level llapd notice
logging level linp notice
logging level lmux notice
logging level lmi notice
logging level lmib notice
logging level lsms notice
logging level lctrl notice
logging level lgtp notice
logging level lstats error
!
line vty
no login
!
e1_input
e1_line 0 driver ipa
e1_line 0 port 0
no e1_line 0 keepalive
phy 0
instance 0
bts 0
band DCS1800
ipa unit-id 6969 0
oml remote-ip 127.0.0.1
rtp jitter-buffer 100
paging queue-size 200
paging lifetime 0
uplink-power-target -75
min-qual-rach 50
min-qual-norm -5
trx 0
power-ramp max-initial 23000 mdBm
power-ramp step-size 2000 mdB
power-ramp step-interval 1
ms-power-control osmo
phy 0 instance 0

26
doc/manuals/Makefile.am Normal file
View File

@@ -0,0 +1,26 @@
EXTRA_DIST = dtx.dot \
osmobts-abis.adoc \
osmobts-abis-docinfo.xml \
osmobts-usermanual.adoc \
osmobts-usermanual-docinfo.xml \
osmobts-vty-reference.xml \
rtp-amr.adoc \
rtp-amr-docinfo.xml \
regen_doc.sh \
abis \
chapters \
vty
if BUILD_MANUALS
ASCIIDOC = osmobts-usermanual.adoc osmobts-abis.adoc rtp-amr.adoc
include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.asciidoc.inc
osmobts-usermanual.pdf: $(srcdir)/chapters/*.adoc
osmobts-abis.pdf: $(srcdir)/abis/*.adoc $(srcdir)/abis/*.msc
rtp-amr.pdf: $(srcdir)/dtx.dot
VTY_REFERENCE = osmobts-vty-reference.xml
include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.vty-reference.inc
OSMO_REPOSITORY = osmo-bts
include $(OSMO_GSM_MANUALS_DIR)/build/Makefile.common.inc
endif

View File

@@ -0,0 +1,23 @@
msc {
bts [label="BTS"], bsc [label="BSC"];
bts => bsc [label="TCP Connect (Port 3002, OML)"];
bts box bsc [label="IPA CCM Identification (Port 3002)"];
bts <= bsc [label="OML Configuration of BTS via OML"];
...;
bts <= bsc [label="OML (TRX=0) IPA RSL CONNECT"];
bts => bsc [label="TCP Connect (Port 3003, RSL, TRX 0)"];
bts box bsc [label="IPA CCM Identification Port 3003"];
bts <= bsc [label="RSL BCCH filling (System Information)"];
bts <= bsc [label="RSL SACCH filling (SI 5/6)"];
...;
bts <= bsc [label="OML (TRX=1) IPA RSL CONNECT"];
bts => bsc [label="TCP Connect (Port 3003, RSL, TRX 1)"];
bts box bsc [label="IPA CCM Identification (Port 3003)"];
bts <= bsc [label="RSL SACCH filling (SI 5/6)"];
...;
bts <= bsc [label="OML (TRX=N) IPA RSL CONNECT"];
bts => bsc [label="TCP Connect (Port 3003, RSL, TRX N)"];
bts box bsc [label="IPA CCM Identification (Port 3003)"];
bts <= bsc [label="RSL SACCH filling (SI 5/6)"];
}

View File

@@ -0,0 +1,23 @@
msc {
hscale = "1.2";
phy,bts,pcu,bsc;
phy box bsc [ label = "PDCH Deactivation" ];
bsc => bts [ label = "IPAC PDCH DEACT" ];
--- [ label = "Disconnect PDTCH" ];
bts => pcu [ label = "info ind (Deactivate)" ];
pcu => bts [ label = "chan Deactivate request" ];
bts => phy [ label = "L1 chan Deactivate PDTCH SAPIs" ];
phy -> bts [ label = "L1 chan Deactivate SAPIs confirm" ];
bts => phy [ label = "L1 chan Disconnect PDTCH" ];
phy -> bts [ label = "L1 chan Disconnect confirm" ];
--- [ label = "Connect TCH" ];
bts => phy [ label = "L1 chan Connect TCH" ];
phy -> bts [ label = "L1 chan Connect confirm" ];
bts => bsc [ label = "IPAC PDCH DEACT ACK" ];
phy box bsc [ label = "Now BSC may use TCH (example)" ];
bsc => bts [ label = "Activate TCH/F" ];
bts => phy [ label = "L1 chan Activate SAPIs" ];
--- [ label = "Voice call..." ];
}

View File

@@ -0,0 +1,22 @@
msc {
hscale = "1.2";
phy,bts,pcu,bsc;
--- [ label = "...Voice call ends" ];
bsc => bts [ label = "Deactivate TCH/F" ];
bts => phy [ label = "L1 chan Deactivate SAPIs" ];
phy box bsc [ label = "PDCH Activation" ];
bsc => bts [ label = "IPAC PDCH ACT" ];
--- [ label = "Disconnect TCH" ];
bts => phy [ label = "L1 chan Disconnect TCH" ];
phy -> bts [ label = "L1 chan Disconnect confirm" ];
--- [ label = "Connect PDTCH" ];
bts => phy [ label = "L1 chan Connect PDTCH" ];
phy -> bts [ label = "L1 chan Connect confirm" ];
bts => pcu [ label = "info ind (Activate)" ];
pcu => bts [ label = "chan Activate request" ];
bts => phy [ label = "L1 chan Activate PDTCH SAPIs" ];
phy -> bts [ label = "L1 chan Activate SAPIs confirm" ];
bts => bsc [ label = "IPAC PDCH ACT ACK" ];
}

View File

@@ -0,0 +1,34 @@
msc {
hscale = "1.5";
phy,bts,pcu,bsc;
bts => bsc [ label = "RSL Chan Requested" ];
phy box bsc [ label = "TS is in PDCH mode, deactivate" ];
bsc => bts [ label = "RSL RF Channel Release (PDCH)" ];
bts => pcu [ label = "Info Ind (Deactivate)" ];
pcu => bts [ label = "Chan Deactivate request" ];
bts => phy [ label = "L1 chan Deactivate PDTCH SAPIs" ];
phy -> bts [ label = "L1 chan Deactivate SAPIs confirm" ];
bts -> bsc [ label = "RSL RF Channel Release Ack (PDCH)" ];
phy box bsc [ label = "Activate TCH/H" ];
bsc => bts [ label = "RSL Channel Activation (TCH/H)" ];
--- [ label = "BTS notices: chan still connected as PDTCH, reconnect" ];
bts => phy [ label = "L1 chan Disconnect PDTCH" ];
phy -> bts [ label = "L1 chan Disconnect confirm" ];
bts => phy [ label = "L1 chan Connect TCH/H" ];
phy -> bts [ label = "L1 chan Connect confirm" ];
--- [ label = "chan reconnect as TCH/H complete" ];
bts => phy [ label = "L1 chan Activate SAPIs" ];
bts -> bsc [ label = "RSL Channel Activation Ack (TCH/H)" ];
--- [ label = "Voice call 1 commences..." ];
phy box bsc [ label = "A second voice call is requested" ];
bts => bsc [ label = "RSL Chan Requested" ];
phy box bsc [ label = "BSC finds second slot on dynamic TS in TCH/H mode" ];
bsc => bts [ label = "RSL Channel Activation (TCH/H)" ];
bts => phy [ label = "L1 chan Activate SAPIs" ];
bts -> bsc [ label = "RSL Channel Activation Ack (TCH/H)" ];
--- [ label = "Voice call 2 commences..." ];
}

View File

@@ -0,0 +1,31 @@
msc {
hscale = "1.5";
phy,bts,pcu,bsc;
--- [ label = "...Voice call 1 ends" ];
bts => bsc [ label = "Release Ind" ];
bsc => bts [ label = "RSL RF Channel Release (TCH/H)" ];
bts => phy [ label = "L1 chan Deactivate SAPIs" ];
bts -> bsc [ label = "RSL RF Channel Release Ack (TCH/H)" ];
--- [ label = "BSC notices: one chan still in use"];
--- [ label = "...Voice call 2 ends" ];
bts => bsc [ label = "Release Ind" ];
bsc => bts [ label = "RSL RF Channel Release (TCH/H)" ];
bts => phy [ label = "L1 chan Deactivate SAPIs" ];
bts -> bsc [ label = "RSL RF Channel Release Ack (TCH/H)" ];
phy box bsc [ label = "If all channels on TS are released, PDCH Activation" ];
bsc => bts [ label = "RSL Channel Activation (PDCH)" ];
bts -> bsc [ label = "RSL Channel Activation Ack (PDCH) (unconditionally)" ];
--- [ label = "BTS notices: chan still connected as TCH/H, reconnect" ];
bts => phy [ label = "L1 chan Disconnect TCH/H" ];
phy -> bts [ label = "L1 chan Disconnect confirm" ];
bts => phy [ label = "L1 chan Connect PDTCH" ];
phy -> bts [ label = "L1 chan Connect confirm" ];
--- [ label = "chan reconnect as PDTCH complete" ];
bts => pcu [ label = "Info Ind (Activate)" ];
pcu => bts [ label = "chan Activate request" ];
bts => phy [ label = "L1 chan Activate PDTCH SAPIs" ];
phy -> bts [ label = "L1 chan Activate SAPIs confirm" ];
}

106
doc/manuals/abis/ipa.adoc Normal file
View File

@@ -0,0 +1,106 @@
== IPA Multiplex
The ETSI/3GPP specifications for A-bis transport (ETSI/3GPP TS 08.56)
specify the transmission of RSL and OML messages over a LAPD based
framing on top of 64kBit/s signalling times slots (B-channels) on E1
lines.
OsmoBTS does not implement this LAPD based transport, but instead
implements A-bis over IP in a flavor first observed by ip.access nanoBTS
products. The OsmoBTS implementation is a clean-room re-implementation
based on the observation and dissection of protocol traces.
LAPD as used in E1 signalling channels provides in-order transmission
and reliable delivery. This is why TCP was chosen as Layer 4 transport
protocol on top of IP. TCP however, is a stream based transport
protocol, which doesn't preserve the boundaries of messages.
To work around this shortcoming, an additional framing layer called the
IPA multiplex was introduced between TCP and the RSL and OML messages.
.Protocol Stacking
[width="30%"]
|===
|RSL + OML (this document)
|IPA (this document)
|TCP (IETF RFC 793)
|IP (IETF RFC 791)
|Ethernet (IEEE 802.3)
|===
=== IPA Header
Each higher-layer PDU is encapsulated by a three-byte IPA header with
the following structure:
.IPA Header Structure
[options="header",cols="10%,15%,15%,60%"]
|===
|Offset (Octets)|Length|Name|Description
|0|2|Length|Length of the variable-length payload section in network
byte order (excluding the length of the IPA Header)
|2|1|Stream Identifier|Identifies the stream of the payload
|3|Variable|Payload|higher-layer PDU (i.e. RSL or OML message)
|===
=== IPA Stream Identifiers
The IPA Stream Identifier serves to differentiate different streams
within the multiplex. In the context of A-bis, it can be seen as
analogous to the LAPD TEI on classic A-bis over E1.
The following IPA stream identifiers are being used in A-bis/IP:
.IPA Stream Identifiers
[options="header",width="70%",cols="20%,20%,60%"]
|===
|Value (Hex)|Name|Description
|0x00|RSL|A-bis RSL according to this document, TRX 0
|0x01|RSL|A-bis RSL according to this document, TRX 1
|0x0n|RSL|A-bis RSL according to this document, TRX n
|0xfe|CCM|IPA Connection Management
|0xff|OML|A-bis OML according to this document
|===
=== IPA Connection Management (CCM)
The IPA Connection Management is a sub-layer underneath the IPA
multiplex which is used to manage the connection itself. It supports
functions like Identity Management and Keep-Alive.
==== Identity Management
When a BTS connects to the BSC, the BSC must identify the connected BTS
somehow. In ETSI/3GPP A-bis, the E1 multiplex + signalling timeslot
number is used for this. In IP, there is no similar usable identity.
Hence, the Unit ID is used for this purpose.
.Procedure for IPA peer identification is as follows
[options="header",cols="20%,80%"]
|===
|Direction|Operation
|BTS -> BSC|BTS connects the TCP connection to be used with IPA
|BTS <- BSC|BSC requests BTS identity with ID_GET
|BTS -> BSC|BTS responds BTS Unit ID with ID_RESP
|BTS <- BSC|BSC responds with ID_ACK, if the Unit ID is known to the BSC
|===
Following the above peer identification procedure, transfer of
higher-level messages such as OML or RSL commences.
==== IPA CCM Messages
IPA CCM supports the following messages
.IPA CCM Messages
[options="header"]
[cols="10%,15%,75%"]
|===
|Value|Name|Purpose
|0x00|PING|Request a PONG from the peer
|0x01|PONG|Response to a PING
|0x04|ID_GET|Request Identity from peer
|0x05|ID_RESP|Response to ID_GET
|0x06|ID_ACK|Identity Acknowledged
|===

View File

@@ -0,0 +1,26 @@
msc {
bts [label="BTS"], bsc [label="BSC"];
# this is for the BTS Object
--- [label="Initial state after establishing OML"];
bts => bsc [label="STATE CHG REP (Disabled/Notinstalled/Locked)"];
--- [label="MO requests software activation"];
bts => bsc [label="SW Activate Req"];
bts <= bsc [label="SW Activate Req Ack"];
--- [label="BTS instructs BTS to activate software"];
bts <= bsc [label="Activate SW"];
bts => bsc [label="Activate SW Ack"];
--- [label="MO reports new state after SW activation"];
bts => bsc [label="STATE CHG REP (Disabled/Dependency)"];
bts => bsc [label="SW Activated Report"];
--- [label="Configure the MO with its attributes"];
bts <= bsc [label="Set BTS Attributes"];
bts => bsc [label="Set BTS Attributes Ack"];
bts <= bsc [label="OPSTART"];
bts => bsc [label="OPSTART ACK"];
--- [label="As this object is locked, we need to unlock it"];
bts <= bsc [label="Change Adm State (Unlocked)"];
bts => bsc [label="Change Adm State Ack (Unlocked)"];
bts => bsc [label="STATE CHG REP (Disabled/Dependency/Unlocked)"];
--- [label="Initialize Radio Transceiver, Radio Carrier, Channels"];
bts => bsc [label="STATE CHG REP (Enabled/OK)"];
}

View File

@@ -0,0 +1,24 @@
msc {
bts [label="Radio Carrier"], bsc [label="BSC"];
--- [label="Initial state after establishing OML"];
bts => bsc [label="STATE CHG REP (Disabled/Notinstalled/Locked)"];
--- [label="MO requests software activation"];
bts => bsc [label="SW Activate Req"];
bts <= bsc [label="SW Activate Req Ack"];
--- [label="BTS instructs BTS to activate software"];
bts <= bsc [label="Activate SW"];
bts => bsc [label="Activate SW Ack"];
--- [label="MO reports new state after SW activation"];
bts => bsc [label="STATE CHG REP (Disabled/Offline)"];
bts => bsc [label="SW Activated Report"];
--- [label="Configure the MO with its attributes"];
bts <= bsc [label="Set Radio Carrier Attributes"];
bts => bsc [label="Set Radio Carrier Attributes Ack"];
bts <= bsc [label="OPSTART"];
bts => bsc [label="OPSTART ACK"];
--- [label="As this object is locked, we need to unlock it"];
bts <= bsc [label="Change Adm State (Unlocked)"];
bts => bsc [label="Change Adm State Ack (Unlocked)"];
bts => bsc [label="STATE CHG REP (Disabled/OK/Unlocked)"];
bts => bsc [label="STATE CHG REP (Enabled)"];
}

View File

@@ -0,0 +1,20 @@
msc {
bts [label="Channel"], bsc [label="BSC"];
--- [label="Initial state after establishing OML"];
bts => bsc [label="STATE CHG REP (Disabled/Notinstalled/Locked)"];
--- [label="MO reports new state after SW activation of Baseband Transceiver"];
bts => bsc [label="STATE CHG REP (Disabled/Dependency)"];
bts => bsc [label="SW Activated Report"];
--- [label="Configure the MO with its attributes"];
bts <= bsc [label="Set Channel Attributes"];
bts => bsc [label="Set Channel Attributes Ack"];
bts <= bsc [label="OPSTART"];
bts => bsc [label="OPSTART ACK"];
--- [label="As this object is locked, we need to unlock it"];
bts <= bsc [label="Change Adm State (Unlocked)"];
bts => bsc [label="Change Adm State Ack (Unlocked)"];
bts => bsc [label="STATE CHG REP (Disabled/Dependency/Unlocked)"];
--- [label="Initialize Radio Carrier / Baseband Transceiver"];
bts => bsc [label="STATE CHG REP (Disabled/Offline)"];
bts => bsc [label="STATE CHG REP (Enabled/OK)"];
}

View File

@@ -0,0 +1,17 @@
msc {
bts [label="Site Manager"], bsc [label="BSC"];
# this is for the Site Manager Object
--- [label="Initial state after establishing OML"];
bts => bsc [label="STATE CHG REP (Disabled/Notinstalled)"];
--- [label="MO requests software activation"];
bts => bsc [label="SW Activate Req"];
bts <= bsc [label="SW Activate Req Ack"];
--- [label="BTS instructs BTS to activate software"];
bts <= bsc [label="Activate SW"];
bts => bsc [label="Activate SW Ack"];
--- [label="MO reports new state after SW activation"];
bts => bsc [label="STATE CHG REP (Enabled)"];
bts => bsc [label="SW Activated Report"];
bts <= bsc [label="OPSTART"];
bts => bsc [label="OPSTART ACK"];
}

View File

@@ -0,0 +1,23 @@
msc {
bts [label="Baseband Transceiver"], bsc [label="BSC"];
--- [label="Initial state after establishing OML"];
bts => bsc [label="STATE CHG REP (Disabled/Notinstalled/Locked)"];
--- [label="MO requests software activation"];
bts => bsc [label="SW Activate Req"];
bts <= bsc [label="SW Activate Req Ack"];
--- [label="BTS instructs BTS to activate software"];
bts <= bsc [label="Activate SW"];
bts => bsc [label="Activate SW Ack"];
--- [label="MO reports new state after SW activation"];
bts => bsc [label="STATE CHG REP (Disabled/Dependency)"];
bts => bsc [label="SW Activated Report"];
--- [label="BSC requests RSL establishment"];
bts <= bsc [label="IPA RSL Connect"];
bts => bsc [label="IPA RSL Connect ACK"];
bts <= bsc [label="OPSTART"];
bts => bsc [label="OPSTART ACK"];
--- [label="As this object is locked, we need to unlock it"];
bts <= bsc [label="Change Adm State (Unlocked)"];
bts => bsc [label="Change Adm State Ack (Unlocked)"];
bts => bsc [label="STATE CHG REP (Disabled/Dependency/Unlocked)"];
}

View File

@@ -0,0 +1,34 @@
msc {
hscale = 2;
chan [label="Channel"], rc [label="Radio Carrier"], smg [label="Site Manager"], bts [label="BTS"], bsc [label="BSC"];
bts => bsc [label="TCP Connect (Port 3003, OML)"];
bts box bsc [label="IPA CCM Identification (Port 3003)"];
|||;
smg => bsc [label="(Site Mgr) STATE CHG REP (Disabled/NotInstalled)"];
bts => bsc [label="(BTS) STATE CHG REP (Disabled/NotInstalled/Locked)"];
rc => bsc [label="(TRANSC) STATE CHG REP (Disabled/NotInstalled/Locked)"];
chan => bsc [label="(Ch 0) STATE CHG REP (Disabled/NotInstalled/Locked)"];
chan => bsc [label="(Ch 1) STATE CHG REP (Disabled/NotInstalled/Locked)"];
chan => bsc [label="(Ch 2) STATE CHG REP (Disabled/NotInstalled/Locked)"];
chan => bsc [label="(Ch 3) STATE CHG REP (Disabled/NotInstalled/Locked)"];
chan => bsc [label="(Ch 4) STATE CHG REP (Disabled/NotInstalled/Locked)"];
chan => bsc [label="(Ch 5) STATE CHG REP (Disabled/NotInstalled/Locked)"];
chan => bsc [label="(Ch 6) STATE CHG REP (Disabled/NotInstalled/Locked)"];
chan => bsc [label="(Ch 7) STATE CHG REP (Disabled/NotInstalled/Locked)"];
rc => bsc [label="(RC) STATE CHG REP (Disabled/NotInstalled/Locked)"];
bts => bsc [label="(GPRS-NSE) STATE CHG REP (Disabled/NotInstalled/Locked)"];
bts => bsc [label="(GPRS-CELL) STATE CHG REP (Disabled/NotInstalled/Locked)"];
bts => bsc [label="(GPRS-NSVC0) STATE CHG REP (Disabled/NotInstalled/Locked)"];
bts => bsc [label="(GPRS-NSVC1) STATE CHG REP (Disabled/NotInstalled/Locked)"];
|||;
smg => bsc [label="(Site Mgr) SW Activate Req"];
smg <= bsc [label="(Site Mgr) SW Activate Req Ack"];
smg <= bsc [label="(Site Mgr) Activate SW"];
smg => bsc [label="(Site Mgr) Activate SW Ack"];
smg => bsc [label="(Site Mgr) STATE CHG REP (Enabled)"];
smg => bsc [label="(Site Mgr) SW Activated Report"];
smg <= bsc [label="(Site Mgr) OPSTART"];
smg => bsc [label="(Site Mgr) OPSTART ACK"];
}

View File

@@ -0,0 +1,50 @@
msc {
hscale = 2;
chan [label="Channel"], rc [label="Radio Carrier"], bts [label="BTS"], bsc [label="BSC"];
bts box bsc [label="OML Connect + Site Manager Init"];
...;
bts => bsc [label="(BTS) SW Activate Req"];
bts <= bsc [label="(BTS) SW Activate Req Ack"];
bts <= bsc [label="(BTS) Activate SW"];
bts => bsc [label="(BTS) Activate SW Ack"];
bts => bsc [label="(BTS) STATE CHG REP (Disabled/Dependency)"];
bts => bsc [label="(BTS) SW Activated Report"];
|||;
rc => bsc [label="(TRANSC) SW Activate Req"];
rc => bsc [label="(RC) SW Activated Req"];
|||;
bts <= bsc [label="(BTS) Set BTS Attributes"];
bts => bsc [label="(BTS) Set BTS Attributes Ack"];
bts <= bsc [label="(BTS) OPSTART"];
bts => bsc [label="(BTS) OPSTART Ack"];
|||;
bts <= bsc [label="(BTS) Change Adm State (Unlocked)"];
bts => bsc [label="(BTS) Change Adm State ACK (Unlocked)"];
bts => bsc [label="(BTS) STATE CHG REP (Disabled/Dependency/Unlcoked)"];
|||;
rc <= bsc [label="(TRANSC) SW Activate Req Ack"];
rc <= bsc [label="(TRANSC) Activate SW"];
rc => bsc [label="(TRANSC) Activate SW Ack"];
rc => bsc [label="(TRANSC) STATE CHG REP (Disabled/Dependency)"];
rc => bsc [label="(TRANSC) SW Activated Report"];
chan => bsc [label="(CHAN 0) STATE CHG REP (Disabled/Dependency)"];
chan => bsc [label="(CHAN 1) STATE CHG REP (Disabled/Dependency)"];
chan => bsc [label="(CHAN 2) STATE CHG REP (Disabled/Dependency)"];
chan => bsc [label="(CHAN 3) STATE CHG REP (Disabled/Dependency)"];
chan => bsc [label="(CHAN 4) STATE CHG REP (Disabled/Dependency)"];
chan => bsc [label="(CHAN 5) STATE CHG REP (Disabled/Dependency)"];
chan => bsc [label="(CHAN 6) STATE CHG REP (Disabled/Dependency)"];
chan => bsc [label="(CHAN 7) STATE CHG REP (Disabled/Dependency)"];
|||;
chan => bsc [label="(CHAN 0) SW Activated Report"];
chan => bsc [label="(CHAN 1) SW Activated Report"];
chan => bsc [label="(CHAN 2) SW Activated Report"];
chan => bsc [label="(CHAN 3) SW Activated Report"];
chan => bsc [label="(CHAN 4) SW Activated Report"];
chan => bsc [label="(CHAN 5) SW Activated Report"];
chan => bsc [label="(CHAN 6) SW Activated Report"];
chan => bsc [label="(CHAN 7) SW Activated Report"];
}

View File

@@ -0,0 +1,51 @@
msc {
hscale = 2;
chan [label="Channel"], rc [label="Radio Carrier"], bts [label="BTS"], bsc [label="BSC"];
...;
rc <= bsc [label="(RC) SW Activate Req Ack"];
rc <= bsc [label="(RC) Activate SW"];
rc => bsc [label="(RC) Activate SW Ack"];
rc => bsc [label="(RC) STATE CHG REP (Disabled/Offline)"];
rc => bsc [label="(RC) SW Activated Report"];
rc <= bsc [label="(TRANSC) IPA RSL Connect"];
rc => bsc [label="(TRANSC) IPA RSL Connect Ack"];
rc <= bsc [label="(TRANSC) OPSTART"];
rc => bsc [label="(TRANSC) OPSTART Ack"];
rc <= bsc [label="(TRANSC) Change Adm State (Unlocked)"];
rc => bsc [label="(TRANSC) Change Adm State Ack (Unlocked)"];
rc => bsc [label="(TRANSC) STATE CHG REP (Disabled/Dependency/Unlocked)"];
|||;
chan <= bsc [label="(CHAN 0) Set Channel Attributes"];
chan => bsc [label="(CHAN 0) Set Channel Attributes Ack"];
chan <= bsc [label="(CHAN 0) OPSTART"];
chan => bsc [label="(CHAN 0) OPSTART Ack"];
chan <= bsc [label="(CHAN 0) Change Adm State (Unlocked)"];
chan => bsc [label="(CHAN 0) Change Adm State Ack (Unlocked)"];
chan => bsc [label="(CHAN 0) STATE CHG REP (Disabled/Dependency/Unlocked)"];
...;
chan <= bsc [label="(CHAN 7) Set Channel Attributes"];
chan => bsc [label="(CHAN 7) Set Channel Attributes Ack"];
chan <= bsc [label="(CHAN 7) OPSTART"];
chan => bsc [label="(CHAN 7) OPSTART Ack"];
chan <= bsc [label="(CHAN 7) Change Adm State (Unlocked)"];
chan => bsc [label="(CHAN 7) Change Adm State Ack (Unlocked)"];
chan => bsc [label="(CHAN 7) STATE CHG REP (Disabled/Dependency/Unlocked)"];
|||;
rc <= bsc [label="(RC) Set Radio Carrier Attributes"];
rc => bsc [label="(RC) Set Radio Carrier Attributes Ack"];
rc <= bsc [label="(RC) OPSTART"];
rc => bsc [label="(RC) OPSTART Ack"];
rc <= bsc [label="(RC) Change Adm State (Unlocked)"];
rc => bsc [label="(RC) Change Adm State Ack (Unlocked)"];
rc => bsc [label="(RC) STATE CHG REP (Disabled/OK/Unlocked)"];
rc => bsc [label="(RC) STATE CHG REP (Enabled)"];
rc => bsc [label="(TRANSC) STATE CHG REP (Disabled/Offline)"];
rc => bsc [label="(TRANSC) STATE CHG REP (Enabled/OK)"];
|||;
chan => bsc [label="(CHAN 0) STATE CHG REP (Disabled/Offline)"];
chan => bsc [label="(CHAN 0) STATE CHG REP (Enabled/OK)"];
|||;
bts => bsc [label="(BTS) STATE CHG REP (Enabled/OK)"];
}

950
doc/manuals/abis/oml.adoc Normal file
View File

@@ -0,0 +1,950 @@
== Organization & Maintenance Link (OML)
=== List of Messages
The following tables list the OML messages used by OsmoBTS, grouped by their
level of compliance with 3GPP TS 12.21.
==== Messages Compliant With TS 12.21
Specific limitations apply, see the linked sections.
.Messages compliant with TS 12.21
[options="header",cols="10%,10%,20%,35%,5%,20%"]
|===
| TS 12.21 § | type code (hex) | This document § | Message | <-/-> | Received/Sent by OsmoBTS
6+<| *SW Download Management Messages:*
| 8.3.7 | 0x10 | <<sw_act_rep>> | SW Activated Report | -> | Sent
6+<| *Air Interface Management Messages:*
.3+.| 8.6.1 | 0x41 .3+.| <<set_bts_attr>> | Set BTS Attributes | <- | Received
| 0x42 | Set BTS Attributes Ack | -> | Sent
| 0x43 | Set BTS Attributes Nack | -> | Sent
.3+.| 8.6.2 | 0x44 .3+.| <<set_radio_attr>> | Set Radio Carrier Attributes | <- | Received
| 0x45 | Set Radio Carrier Attributes Ack | -> | Sent
| 0x46 | Set Radio Carrier Attributes Nack | -> | Sent
.3+.| 8.6.3 | 0x47 .3+.| <<set_chan_attr>> | Set Channel Attributes | <- | Received
| 0x48 | Set Channel Attributes Ack | -> | Sent
| 0x49 | Set Channel Attributes Nack | -> | Sent
6+<| *State Management and Event Report Messages:*
| 8.8.1 | 0x61 | <<state_changed_rep>> | State Changed Event Report | -> | Sent
.3+.| 8.8.5 | 0x69 .3+.| <<chg_adm_state>> | Change Administrative State | <- | Received
| 0x6A | Change Administrative State Ack | -> | Sent
| 0x6B | Change Administrative State Nack | -> | Sent
6+<| *Equipment Management Messages:*
.3+.| 8.9.2 | 0x74 .3+.| <<opstart>> | Opstart | <- | Received
| 0x75 | Opstart Ack | -> | Sent
| 0x76 | Opstart Nack | -> | Sent
|===
==== Messages Specific to OsmoBTS
.Messages specific to OsmoBTS, not found in 3GPP TS 12.21
[options="header"]
[options="header",cols="20%,55%,5%,20%"]
|===
| This document § | Message | <-/-> | Received/Sent by OsmoBTS
| <<ipacc_set_attr>> | Set Attribute | <- | Received
|===
==== Messages Not Implemented by OsmoBTS
.3GPP TS 12.21 messages not implemented by OsmoBTS
[options="header",cols="10%,10%,80%"]
|===
| TS 12.21 § | type code (hex) | Message
3+<| *SW Download Management Messages:*
.3+.| 8.3.1 | 0x01 | Load Data Initiate
| 0x02 | Load Data Initiate Ack
| 0x03 | Load Data Initiate Nack
.2+.| 8.3.2 | 0x04 | Load Data Segment
| 0x05 | Load Data Segment Ack
| 8.3.3 | 0x06 | Load Data Abort
.3+.| 8.3.4 | 0x07 | Load Data End
| 0x08 | Load Data End Ack
| 0x09 | Load Data End Nack
.3+.| 8.3.5 | 0x0A | SW Activate Request
| 0x0B | SW Activate Request Ack
| 0x0C | SW Activate Request Nack
.3+.| 8.3.6 | 0x0D | Activate SW
| 0x0E | Activate SW Ack
| 0x0F | Activate SW Nack
3+<| *A-bis Interface Management Messages:*
.3+.| 8.4.1 | 0x21 | Establish TEI
| 0x22 | Establish TEI Ack
| 0x23 | Establish TEI Nack
.3+.| 8.4.2 | 0x24 | Connect Terrestrial Signalling
| 0x25 | Connect Terrestrial Signalling Ack
| 0x26 | Connect Terrestrial Signalling Nack
.3+.| 8.4.3 | 0x27 | Disconnect Terrestrial Signalling
| 0x28 | Disconnect Terrestrial Signalling Ack
| 0x29 | Disconnect Terrestrial Signalling Nack
.3+.| 8.4.4 | 0x2A | Connect Terrestrial Traffic
| 0x2B | Connect Terrestrial Traffic Ack
| 0x2C | Connect Terrestrial Traffic Nack
.3+.| 8.4.5 | 0x2D | Disconnect Terrestrial Traffic
| 0x2E | Disconnect Terrestrial Traffic Ack
| 0x2F | Disconnect Terrestrial Traffic Nack
3+<| *Transmission Management Messages:*
.3+.| 8.5.1 | 0x31 | Connect Multi-Drop Link
| 0x32 | Connect Multi-Drop Link Ack
| 0x33 | Connect Multi-Drop Link Nack
.3+.| 8.5.2 | 0x34 | Disconnect Multi-Drop Link
| 0x35 | Disconnect Multi-Drop Link Ack
| 0x36 | Disconnect Multi-Drop Link Nack
3+<| *Test Management Messages:*
.3+.| 8.7.1 | 0x51 | Perform Test
| 0x52 | Perform Test Ack
| 0x53 | Perform Test Nack
.3+.| 8.7.2 | 0x54 | Test Report
| 0x55 | Send Test Report
| 0x56 | Send Test Report Ack
| 8.7.3 | 0x57 | Send Test Report Nack
.3+.| 8.7.4 | 0x58 | Stop Test
| 0x59 | Stop Test Ack
| 0x5A | Stop Test Nack
3+<| *State Management and Event Report Messages:*
| 8.8.2 | 0x62 | Failure Event Report
.3+.| 8.8.3 | 0x63 | Stop Sending Event Reports
| 0x64 | Stop Sending Event Reports Ack
| 0x65 | Stop Sending Event Reports Nack
.3+.| 8.8.4 | 0x66 | Restart Sending Event Reports
| 0x67 | Restart Sending Event Reports Ack
| 0x68 | Restart Sending Event Reports Nack
.3+.| 8.8.6 | 0x6C | Change Administrative State Request
| 0x6D | Change Administrative State Request Ack
| 0x6E | Change Administrative State Request Nack
.3+.| 8.8.7 | 0x93 | Report Outstanding Alarms
| 0x94 | Report Outstanding Alarms Ack
| 0x95 | Report Outstanding Alarms Nack
3+<| *Equipment Management Messages:*
.3+.| 8.9.1 | 0x71 | Changeover
| 0x72 | Changeover Ack
| 0x73 | Changeover Nack
.3+.| 8.9.3 | 0x87 | Reinitialize
| 0x88 | Reinitialize Ack
| 0x89 | Reinitialize Nack
.3+.| 8.9.4 | 0x77 | Set Site Outputs
| 0x78 | Set Site Outputs Ack
| 0x79 | Set Site Outputs Nack
.3+.| 8.9.5 | 0x90 | Change HW Configuration
| 0x91 | Change HW Configuration Ack
| 0x92 | Change HW Configuration Nack
3+<| *Measurement Management Messages:*
| 8.10.1 | 0x8A | Measurement Result Request
| 8.10.2 | 0x8B | Measurement Result Response
| 8.10.3 | 0x8C | Stop Measurement
| 8.10.4 | 0x8D | Start Measurement
3+<| *Other Messages:*
| 8.11.1 | 0x81 | Get Attributes
| 8.11.3 | 0x82 | Get Attribute(s) Response
| 8.11.1 | 0x83 | Get Attributes Nack
.3+.| 8.11.2 | 0x84 | Set Alarm Threshold
| 0x85 | Set Alarm Threshold Ack
| 0x86 | Set Alarm Threshold Nack
|===
=== Details on Compliant OML Messages
[[sw_act_rep]]
==== SW Activated Report
OsmoBTS will send an _SW Activated Report_ when RF has been activated
successfully. The message is compliant with 3GPP TS 12.21 § 8.3.7.
Upon RF activation, two _SW Activated Report_ messages will be sent, for the Object Classes
- Radio Carrier (0x02)
- Baseband Transceiver (0x04)
[[set_bts_attr]]
==== Set BTS Attributes
OsmoBTS will receive a _Set BTS Attributes_ message and reply with a
corresponding ACK message on success. IE handling is fully compliant to TS
12.21, except that a change of BCCH ARFCN or BSIC while in operation is not
supported, and hence the _Starting Time_ IE is rejected.
._Set BTS Attributes_ IEs not handled by OsmoBTS
[options="header",cols="10%,30%,60%"]
|===
| TS 12.21 § | IE Name | Handling
| 9.4.52 | Starting Time | not supported (provokes NACK cause 0x10)
|===
[[set_radio_attr]]
==== Set Radio Carrier Attributes
This message conforms to 3GPP TS 12.21, with the following limitation,
as frequency hopping is not supported by OsmoBTS:
._Set Radio Carrier Attributes_ IE limitations
[options="header",cols="10%,30%,60%"]
|===
| TS 12.21 § | IE Name | Handling
| 9.4.5 | ARFCN List | ignored
|===
[[set_chan_attr]]
==== Set Channel Attributes
This message conforms to 3GPP TS 12.21, with the following limitation: the
following 3GPP TS 12.21 IEs provoke a NACK response when sent to OsmoBTS, as
frequency hopping is not supported:
._Set Channel Attributes_ IE limitations
[options="header",cols="10%,30%,60%"]
|===
| TS 12.21 § | IE Name | Handling
| 9.4.21 | HSN | not supported (provokes NACK cause 0x10)
| 9.4.27 | MAIO | not supported (provokes NACK cause 0x10)
| 9.4.52 | Starting Time | not supported (provokes NACK cause 0x10)
|===
[[state_changed_rep]]
==== State Changed Event Report
This message is compliant with 3GPP TS 12.21. Exactly these IEs are sent by
OsmoBTS:
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message Type (0xf5) | 3GPP TS 12.21 9.1 | M | V | 1
| Object Class | 3GPP TS 12.21 9.2 | M | V | 1
| Object Instance | 3GPP TS 12.21 9.3 | M | V | 3
| Operational State | 3GPP TS 12.21 9.4.38 | O | TV | 2
| Availability Status | 3GPP TS 12.21 9.4.7 | O | TL16V (with length of 1) | 3
|===
[[chg_adm_state]]
==== Change Administrative State
This message is compliant with 3GPP TS 12.21 § 8.8.5. It applies to all of the
Object Classes defined in 3GPP TS 12.21 § 9.2 as well as
<<addnl_obj_classes>>.
[[opstart]]
==== Opstart
This message is compliant with 3GPP TS 12.21 § 8.9.2. It applies to all of the
Object Classes defined in 3GPP TS 12.21 § 9.2 as well as
<<addnl_obj_classes>>.
=== Details on OsmoBTS Specific Messages
[[ipacc_set_attr]]
==== Set Attribute
The message type is 0xf5. This message is sent to OsmoBTS to set
attributes on instances of managed objects of the non-standard
additional Object Classes (see <<addnl_obj_classes>>).
The message specifics depend on the Object Class and are detailed in
<<addnl_obj_classes>>.
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message Type (0xf5) | 3GPP TS 12.21 9.1 | M | V | 1
| Object Class | 3GPP TS 12.21 9.2 | M | V | 1
| Object Instance | 3GPP TS 12.21 9.3 | M | V | 3
5+<| _Object Class specific IEs follow, see <<addnl_obj_classes>>..._
|===
[[addnl_obj_classes]]
=== Additional Object Classes
In addition to 3GPP TS 12.21 Chapter 9.2, the following managed objects
are supported:
.Additional Managed Object Classes
[options="header"]
[cols="20%,20%,60%"]
|===
| Value | Name | Description
| 0xf0 | GPRS NSE | GPRS-NS Entity
| 0xf1 | GPRS CELL | GPRS Cell Entity
| 0xf2 | GPRS NSVC | GPRS NS Virtual Circuit
|===
==== GPRS-NSE Managed Object
There is one NS Entity per BTS. It supports the *Set Attribute* message
with the following Information Elements:
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message Type | 3GPP TS 12.21 9.1 | M | V | 1
| Object Class | 3GPP TS 12.21 9.2 | M | V | 1
| Object Instance | 3GPP TS 12.21 9.3 | M | V | 3
| GPRS NSEI | <<NM_ATT_IPACC_NSEI>> | O | TL16V | >= 5
| GPRS NS Configuration | <<NM_ATT_IPACC_NS_LINK_CFG>> | O | TL16V | >= 10
| GPRS BSSGP Configuration | <<NM_ATT_IPACC_BSSGP_CFG>> | O | TL16V | >= 14
|===
==== GPRS Cell Managed Object
There is one GPRS Cell entity per BTS. It supports the *Set Attribute*
message with the following Information Elements:
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message Type | 3GPP TS 12.21 9.1 | M | V | 1
| Object Class | 3GPP TS 12.21 9.2 | M | V | 1
| Object Instance | 3GPP TS 12.21 9.3 | M | V | 3
| GPRS Routing Area Code | <<NM_ATT_IPACC_RAC>> | O | TL16V | >= 4
| GPRS Paging Configuration | <<NM_ATT_IPACC_GPRS_PAGING_CFG>> | O | TL16V | >= 5
| GPRS RLC Configuration | <<NM_ATT_IPACC_RLC_CFG>> | O | TL16V | >= 12
| GPRS Coding Schemes | <<NM_ATT_IPACC_CODING_SCHEMES>> | O | TL16V | >= 5
| GPRS RLC Configuration 2 | <<NM_ATT_IPACC_RLC_CFG_2>> | O | TL16V | >= 8
| GPRS RLC Configuration 3 | <<NM_ATT_IPACC_RLC_CFG_3>> | O | TL16V | >= 4
|===
==== GPRS NS-VC Managed Object
There are two GPRS NS-VC instances per BTS. It supports the *Set
Attribute* message with the following Information Elements:
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message Type | 3GPP TS 12.21 9.1 | M | V | 1
| Object Class | 3GPP TS 12.21 9.2 | M | V | 1
| Object Instance | 3GPP TS 12.21 9.3 | M | V | 3
| GPRS NSVCI | <<NM_ATT_IPACC_NSVCI>> | O | TL16V | >= 5
| GPRS NS Link Configuration | <<NM_ATT_IPACC_NS_LINK_CFG>> | O | TL16V | >= 11
|===
=== Information Elements Overview
All of the IEs handled by OsmoBTS are listed below, with limitations and
additions to TS 12.21 specified in more detail.
==== IEs Conforming to TS 12.21
The following Information Elements are accepted by OsmoBTS.
IEs marked __ignored__ may be sent to OsmoBTS without causing error
conditions. These IEs are skipped during message parsing and are never
evaluated.
IEs marked __ignored__ and additionally marked as being received by OsmoBTS
(<-) are in fact parsed and their values are stored by OsmoBTS, but these
stored items are currently not used in the OsmoBTS code base.
.IEs conforming to TS 12.21
[options="header",cols="5%,10%,40%,5%,40%"]
|===
| tag (hex) | TS 12.21 § | IE name | <-/-> | Received/Sent by OsmoBTS
| 0x00 | 9.4.1 | Abis Channel | | _ignored_
| 0x01 | 9.4.2 | Additional Info | | _ignored_
| 0x02 | 9.4.3 | Additional Text | | _ignored_
| 0x03 | 9.4.4 | Administrative State | <- -> | Received & Sent
| 0x04 | 9.4.5 | ARFCN List | <- | Received, with exactly 1 ARFCN: see <<NM_ATT_ARFCN_LIST>>;
ignored by _Set Radio Attribute_ message (<<set_radio_attr>>)
| 0x05 | 9.4.6 | Autonomously Report | | _ignored_
| 0x06 | 9.4.7 | Availability Status | -> | Sent
| 0x07 | 9.4.8 | BCCH ARFCN | <- | Received
| 0x08 | 9.4.9 | BSIC | <- | Received
| 0x09 | 9.4.10 | BTS Air Timer | <- | Received
| 0x0a | 9.4.11 | CCCH Load Indication Period | <- | Received
| 0x0b | 9.4.12 | CCCH Load Threshold | <- | Received
| 0x0c | 9.4.13 | Channel Combination | <- | Received, with additional channel combinations: see <<ie_chan_comb>>
| 0x0d | 9.4.14 | Connection Failure Criterion | <- | Received, with limitations see <<ie_conn_fail_crit>>
| 0x0e | 9.4.15 | Destination | | _ignored_
| 0x0f | 9.4.16 | Event Type | | _ignored_
| 0x11 | 9.4.17 | File Data | | _ignored_
| 0x12 | 9.4.18 | File Id | | _ignored_
| 0x13 | 9.4.19 | File Version | | _ignored_
| 0x14 | 9.4.20 | GSM Time | | _ignored_
| 0x16 | 9.4.22 | HW Configuration | | _ignored_
| 0x18 | 9.4.24 | Intave Parameter | <- | _ignored_
| 0x19 | 9.4.25 | Interference level Boundaries | <- | _ignored_
| 0x1a | 9.4.26 | List of Required Attributes | | _ignored_
| 0x1c | 9.4.28 | Manufacturer Dependent State | | _ignored_
| 0x1d | 9.4.29 | Manufacturer Dependent Thresholds | | _ignored_
| 0x1e | 9.4.30 | Manufacturer Id | | _ignored_
| 0x1f | 9.4.31 | Max Timing Advance | <- | Received
| 0x20 | 9.4.34 | Multi-drop BSC Link | | _ignored_
| 0x21 | 9.4.35 | Multi-drop next BTS Link | | _ignored_
| 0x22 | 9.4.36 | Nack Causes | -> | Sent
| 0x23 | 9.4.37 | Ny1 | <- | Received
| 0x24 | 9.4.38 | Operational State | -> | Sent
| 0x25 | 9.4.39 | Overload Period | <- | _ignored_
| 0x26 | 9.4.40 | Physical Config | | _ignored_
| 0x27 | 9.4.41 | Power Class | | _ignored_
| 0x28 | 9.4.42 | Power Output Thresholds | | _ignored_
| 0x29 | 9.4.43 | Probable Cause | | _ignored_
| 0x2a | 9.4.44 | RACH Busy Threshold | <- | Received
| 0x2b | 9.4.45 | RACH Load Averaging Slots | <- | _ignored_
| 0x2c | 9.4.46 | Radio Sub Channel | | _ignored_
| 0x2d | 9.4.47 | RF Max Power Reduction | <- | Received
| 0x2e | 9.4.48 | Site Inputs | | _ignored_
| 0x2f | 9.4.49 | Site Outputs | | _ignored_
| 0x30 | 9.4.50 | Source | | _ignored_
| 0x31 | 9.4.51 | Specific Problems | | _ignored_
| 0x33 | 9.4.53 | T200 | <- | _ignored_ (1s on DCCH, 2s on ACCH)
| 0x34 | 9.4.54 | TEI | | _ignored_
| 0x35 | 9.4.55 | Test Duration | | _ignored_
| 0x36 | 9.4.56 | Test No | | _ignored_
| 0x37 | 9.4.57 | Test Report Info | | _ignored_
| 0x38 | 9.4.58 | VSWR Thresholds | | _ignored_
| 0x39 | 9.4.59 | Window Size | | _ignored_
| 0x40 | 9.4.60 | TSC | <- | Received, with limitations: see <<NM_ATT_TSC>>
| 0x41 | 9.4.61 | SW Configuration | | _ignored_
| 0x43 | 9.4.63 | Perceived Severity | | _ignored_
| 0x44 | 9.4.64 | Get Attribute Response Info | | _ignored_
| 0x45 | 9.4.65 | Outstanding Alarm Sequence | | _ignored_
| 0x46 | 9.4.66 | HW Conf Change Info | | _ignored_
| 0x47 | 9.4.32 | Measurement Result | | _ignored_
|===
==== IEs Not Conforming to TS 12.21
.IEs not conforming to TS 12.21
[options="header",cols="5%,10%,30%,55%"]
|===
| tag (hex) | TS 12.21 § | IE name | Description
| 0x15 | 9.4.21 | HSN | presence causes NACK response
| 0x17 | 9.4.23 | HW Description | _ignored_ by OsmoBTS, but coding may differ, see <<ie_hw_desc>>
| 0x1b | 9.4.27 | MAIO | presence causes NACK response
| 0x32 | 9.4.52 | Starting Time | presence causes NACK response
| 0x42 | 9.4.62 | SW Description | not supported
| 0x48 | 9.4.33 | Measurement Type | not supported
|===
==== Additional Attributes and Parameters
The following Information Elements are defined in addition to those
specified in 3GPP TS 12.21 Chapter 9.4.
All of these additional IEs are _received_ by OsmoBTS.
These attributes are not used by OsmoBTS, but
simply passed to OsmoPCU connected to the PCU socket.
.Additional IEs handled by OsmoBTS but not defined in TS 12.21
[options="header",cols="5%,50%,45%"]
|===
| tag (hex) | IE name | Description
| 0x80 | RSL Destination IP Address | <<NM_ATT_IPACC_DST_IP>>
| 0x81 | RSL Destination TCP Port | <<NM_ATT_IPACC_DST_IP_PORT>>
| 0x85 | RSL IPA Stream ID | <<NM_ATT_IPACC_STREAM_ID>>
| 0x9a | GPRS Routing Area Code | <<NM_ATT_IPACC_RAC>>
| 0x9c | GPRS Paging Configuration | <<NM_ATT_IPACC_GPRS_PAGING_CFG>>
| 0x9d | GPRS NSEI | <<NM_ATT_IPACC_NSEI>>
| 0x9e | GPRS BVCI | <<NM_ATT_IPACC_BVCI>>
| 0x9f | GPRS NSVCI | <<NM_ATT_IPACC_NSVCI>>
| 0xa0 | GPRS NS Configuration | <<NM_ATT_IPACC_NS_CFG>>
| 0xa1 | GPRS BSSGP Configuration | <<NM_ATT_IPACC_BSSGP_CFG>>
| 0xa2 | GPRS NS Link Configuration | <<NM_ATT_IPACC_NS_LINK_CFG>>
| 0xa3 | GPRS RLC Configuration | <<NM_ATT_IPACC_RLC_CFG>>
| 0xa8 | GPRS Coding Schemes | <<NM_ATT_IPACC_CODING_SCHEMES>>
| 0xa9 | GPRS RLC Configuration 2 | <<NM_ATT_IPACC_RLC_CFG_2>>
| 0xac | GPRS RLC Configuration 3 | <<NM_ATT_IPACC_RLC_CFG_3>>
|===
=== Details on IEs
[[ie_hw_desc]]
==== HW Description
TS 12.21 suggests a series of 5 length-value pairs for the _HW Description_ IE.
Instead, OsmoBTS interprets it as a single TL16V. The value of this IE is
ignored by OsmoBTS, yet the coding may affect message parsing.
[width="40%",cols="90%,10%"]
[grid="none"]
|===
| Attribute Identifier (0x17) | 1
| Length | 2-3
| Ignored | N
|===
[[NM_ATT_ARFCN_LIST]]
==== ARFCN List
Since OsmoBTS does not support frequency hopping, the _ARFCN List_ must contain
exactly one ARFCN.
[[ie_chan_comb]]
==== Additional Channel Combinations
In addition to 3GPP TS 12.21 Chapter 9.4.13, the following channel
combinations are supported:
.Additional Channel Combinations
[options="header"]
[cols="10%,90%"]
|===
| Value | Description
| 0x0b | Reserved for PBCCH + PCCCH + PDTCH/F + PACCH/F + PTCCH/F
| 0x0c | Reserved for PBCCH + PDTCH/F + PACCH/F + PTCCH/F
| 0x0d | PDTCH/F + PACCH/F + PTCCH/F
| 0x80 | ip.access style Dynamic TCH/F / PDCH
| 0x81 | Reserved for Dynamic TCH/F / TCH/H
| 0x90 | Osmocom style Dynamic TCH/F / TCH/H / PDCH
|===
The _Reserved_ combinations are not actually supported/implemented
yet, but merely reserved for such functionality, if it is eventually
implemented.
For more information on how the different dynamic channel combinations
work, please see the <<rsl-dynamic-channels>>.
[[ie_conn_fail_crit]]
==== Connection Failure Criterion
3GPP TS 12.21 Chapter 9.4.14 specifies two different options for the
_Connection Failure Criterion_. OsmoBTS only implements the option
coded as 0x01, i.e. based upon uplink SACCH error rate
(RADIO_LINK_TIMEOUT).
[[NM_ATT_TSC]]
==== TSC
Due to limitations in the currently supported PHY implementations,
OsmoBTS supports only one global TSC for all channels on one TRX, rather
than a separate TSC for each timeslot, as expected by 3GPP TS 12.21.
[[NM_ATT_IPACC_DST_IP]]
==== RSL Destination IP Address
The value part of this attribute has a length of 4 octets and is encoded
as IPv4 address in network byte order.
[width="40%",cols="90%,10%"]
[grid="none"]
|===
| Attribute Identifier (0x80) | 1
| IPv4 Address (MSB first) | 2-5
|===
[[NM_ATT_IPACC_DST_IP_PORT]]
==== RSL Destination TCP Port
The value part of this attribute has a length of 2 octets and contains
the TCP destination port for the RSL connection, encoded in network byte
order.
[width="40%",cols="90%,10%"]
[grid="none"]
|===
| Attribute Identifier (0x81) | 1
| Port number (MSB first) | 2-3
|===
[[NM_ATT_IPACC_STREAM_ID]]
==== RSL IPA Stream ID
The value part of this attribute has a length of one octet and specifies
the IPA stream ID to be used for the RSL connection of this TRX.
[width="40%",cols="90%,10%"]
[grid="none"]
|===
| Attribute Identifier (0x85) | 1
| Stream ID | 2
|===
[[NM_ATT_IPACC_RAC]]
==== GPRS Routing Area Code
The value part of the GPRS Routing Area code consists of a single octet
encoding the GPRS Routing Area Code.
This attribute is not used by OsmoBTS, but
simply passed to OsmoPCU connected to the PCU socket.
[[NM_ATT_IPACC_GPRS_PAGING_CFG]]
==== GPRS Paging Configuration
The value part of this attribute consists of two octets encoded as
follows:
[options="header"]
[cols="10%,90%"]
|===
| Offset | Description
| 0 | GPRS Paging repeat time in units of 50ms intervals
| 1 | GPRS Paging repeat count
|===
[[NM_ATT_IPACC_NSEI]]
==== GPRS NSEI
The value part of the GPRS NSEI is encoded as 16bit integer value in
network byte order.
This attribute is not used by OsmoBTS, but
simply passed to OsmoPCU connected to the PCU socket.
[[NM_ATT_IPACC_BVCI]]
==== GPRS BVCI
The value part of this attribute consists of two octets encoding the
BSSGP Virtual Circuit Identifier (BVCI) as unsigned 16 bit integer in
network byte order.
[[NM_ATT_IPACC_NSVCI]]
==== GPRS NSVCI
The value part of the GPRS NSVCI attribute is a 16bit unsigned integer
in network byte order, encoding the GPRS NSVCI as specified in 3GPP TS
08.16.
This attribute is not used by OsmoBTS, but
simply passed to OsmoPCU connected to the PCU socket.
[[NM_ATT_IPACC_NS_CFG]]
==== GPRS NS Configuration
The value part of the GPRS NS Configuration consists of an array of 7 octets,
each describing one GPRS NS related timer:
This attribute is not used by OsmoBTS, but
simply passed to OsmoPCU connected to the PCU socket.
[[NM_ATT_IPACC_BSSGP_CFG]]
==== GPRS BSSGP Configuration
The value part of the GPRS BSSGP configuration consists of an array of
11 octets, each describing one GPRS BSSGP related timer:
[options="header"]
[cols="10%,90%"]
|===
| Offset | Description
| 0 | Blocking Timer (T1)
| 1 | Blocking Retries
| 2 | Unblocking Retries
| 3 | Reset Timer (T2)
| 4 | Reset Retries
| 5 | Suspend Timer (T3) in units of 100ms
| 6 | Suspend Retries
| 7 | Resume Timer (T4) in units of 100ms
| 8 | Resume Retries
| 9 | Capability Update Timer (T5)
| 10 | Capability Update Retries
|===
The detailed description of the meaning of those timers is given in the
GPRS BSSGP specification 3GPP TS 08.18.
This attribute is not used by OsmoBTS, but
simply passed to OsmoPCU connected to the PCU socket.
[[NM_ATT_IPACC_NS_LINK_CFG]]
==== GPRS NS Link Configuration
This attribute is 8 octets long and encoded as follows:
[options="header"]
[cols="10%,10%,80%"]
|===
| Offset | Length | Description
| 0 | 2 | GPRS-NS Remote UDP Port Number (SGSN side)
| 2 | 4 | GPRS-NS Remote IPv4 Address (SGSN side)
| 6 | 2 | GPRS-NS Local UDP Port Number (BTS side)
|===
All values are encoded in network byte order.
This attribute is not used by OsmoBTS, but
simply passed to OsmoPCU connected to the PCU socket.
[[NM_ATT_IPACC_RLC_CFG]]
==== GPRS RLC Configuration
The value part of the GPRS RLC Configuration consists of an array of 9
octets, each describing a RLC timer:
[options="header"]
[width="60%",cols="10%,80%,10%"]
|===
| Offset | Description | Unit
| 0 | GPRS RLC Timer T3142 | s
| 1 | GPRS RLC Timer T3169 | s
| 2 | GPRS RLC Timer T3191 | s
| 3 | GPRS RLC Timer T3193 | 10ms
| 4 | GPRS RLC Timer T3195 | s
| 5 | GPRS RLC Timer T3101 | s
| 6 | GPRS RLC Timer T3103 | s
| 7 | GPRS RLC Timer T3105 | s
| 8 | GPRS RLC CV Countdown | -
|===
The meaning of the RLC timers are specified in 3GPP TS 04.60.
The countdown value specifies the RLC CV value from which the countdown
procedure is started.
This attribute is not used by OsmoBTS, but
simply passed to OsmoPCU connected to the PCU socket.
[[NM_ATT_IPACC_CODING_SCHEMES]]
==== GPRS Coding Schemes
The value part of the GPRS Coding Schemes consists of two octets
encoding the available GPRS and EDGE coding schemes.
[options="header"]
|===
| *bit* | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0
| byte at offset 0 | MCS9 | x | x | x | CS4 | CS3 | CS2 | CS1
| byte at offset 1 | MCS8 | MCS7| MCS6 | MCS5 | MCS4| MCS3 | MCS2 | MCS1
|===
This attribute is not used by OsmoBTS, but
simply passed to OsmoPCU connected to the PCU socket.
[[NM_ATT_IPACC_RLC_CFG_2]]
==== GPRS RLC Configuration 2
The value part of this attribute is 8 octets long and encoded as
follows:
[options="header"]
[width="60%",cols="10%,10%,70%,10%"]
|===
| Offset | Length | Description | Unit
| 0 | 2 | Downlink TBF Extension Timer | 10ms
| 2 | 2 | Uplink TBF Extension Timer | 10ms
| 4 | 2 | Initial GPRS Coding Scheme | -
|===
The Initial GPRS Coding Scheme is encoded as follows:
[options="header"]
[width="40%",cols="50%,50%"]
|===
| Value | Description
| 1 | CS 1
| 2 | CS 2
| 3 | CS 3
| 4 | CS 4
|===
This attribute is not used by OsmoBTS, but
simply passed to OsmoPCU connected to the PCU socket.
[[NM_ATT_IPACC_RLC_CFG_3]]
==== GPRS RLC Configuration 3
This attribute contains information about the initial MCS used for new EDGE
TBFs.
It is encoded as follows:
[options="header"]
[width="40%",cols="50%,50%"]
|===
| Value | Description
| 1 | MCS 1
| 2 | MCS 2
| 3 | MCS 3
| 4 | MCS 4
| 5 | MCS 5
| 6 | MCS 6
| 7 | MCS 7
| 8 | MCS 8
| 9 | MCS 9
|===
This attribute is not used by OsmoBTS, but
simply passed to OsmoPCU connected to the PCU socket.
=== A-bis OML Initialization / BTS bring-up
At the time an Abis/IP BTS connects to via OML to the BSC, it is
initialized according to the procedures described in 3GPP TS 12.21 as
amended by this document.
Each Managed Object (MO) is separately initialized. The initialization
sequence and parameters differ slightly depending on the MO involved.
Some parts of the sequences described below are optional, such as the
Software activation. In the OsmoBTS case, the software is not modular
and thus all MOs start with the software fully activated. In effect, no
__Software Activate Request__ is being sent by the MO to the BSC, nor
does the BSC need to initialize the __Activate Software__ procedure.
Still, the full sequences are shown in order to explain the Abis/IP
protocol.
Also, the initial state of the MOs at time of OML connection
initialization is not always guaranteed to be __Disabled/Notinstalled__.
Rather, the BSC implementation has to deal with the initial state as
reported by the MOs at time of re-connection.
==== Site Manager MO Initialization
.A-bis OML Initialization of Site Manager MO
["mscgen"]
----
include::oml-mo-sitemgr.msc[]
----
The Site Manager MO does not depend on other MOs, nor does it have an
Administrative state (__Locked/Unlocked__), thus it immediately commences in
the __Enabled__ state.
==== BTS MO Initialization
.A-bis OML Initialization of BTS MO
["mscgen"]
----
include::oml-mo-bts.msc[]
----
As shown in the BTS MO, its state is
* Availability state __Dependency__, meaning it depends on other MOs to
be initialized before becoming enabled.
* Administrative state __Locked__, as the object is first waiting to
receive attributes in the __Locked__ state, before the __Change
Administrative State (Unlocked)__ procedure is used to request
transitioning into Unlocked state.
==== Baseband Transceiver MO Initialization
.A-bis OML Initialization of Baseband Transceiver MO
["mscgen"]
----
include::oml-mo-transceiver.msc[]
----
There is one Baseband Transceiver MO per TRX in the BTS. For a
multi-TRX BTS, the above procedure must be repeated for each TRX.
==== Radio Carrier MO Initialization
.A-bis OML Initialization of Radio Carrier MO
["mscgen"]
----
include::oml-mo-carrier.msc[]
----
There is one Radio Carrier MO per TRX in the BTS. For a multi-TRX BTS,
the above procedure must be repeated for each TRX.
==== Channel MO Initialization
.A-bis OML Initialization of Radio Carrier MO
["mscgen"]
----
include::oml-mo-channel.msc[]
----
There are 8 timeslots in each TRX, and correspondingly 8 Channel MOs in
every TRX. The above procedure must thus be repeated for each timeslot
in each transceiver of the BTS.
==== Complete BTS Initialization Procedure
Some of below steps are optional, as is their detailed ordering. In
practice, the procedures for different MOs may overlap. The message
sequence charts in this document have been hand-crafted to avoid such
overlap for the sake of clarity.
[[oml-msc-1]]
.A-bis OML BTS bring-up (1/3)
["mscgen"]
----
include::oml-startup.msc[]
----
As shown in <<oml-msc-1>>, after the OML TCP connection is established,
. the identity is exchanged via IPA CCM,
. the BTS sends an 'OML EVENT STATE CHANGED REPORT' for every
Managed Object, and
. the BTS subsequently requests the activation of its 'Site Manager' Object
which the BSC performs by the 'Activate SW' command.
. After successful activation of the software in the Site Manager,
.. the state changes to 'Enabled', and an event report is generated
accordingly, and
.. the BSC is notified about the SW activation in an associated report.
. Finally, the BSC requests the start of the Site Manager
.. using the 'OPSTART' command,
.. which is subsequently acknowledged by the Site Manager.
[[oml-msc-2]]
.A-bis OML BTS bring-up (2/3)
["mscgen"]
----
include::oml-startup2.msc[]
----
[[oml-msc-3]]
.A-bis OML BTS bring-up (3/3)
["mscgen"]
----
include::oml-startup3.msc[]
----
<<oml-msc-2>> shows:
. Software Activation and associated state transitions of the BTS MO;
. Setting of the BTS Attributes followed by OPSTART;
. Software Activation and associated state transitions of the 'Baseband
Transceiver' MO;
. Software Activation and associated state transitions of the 'Radio
Carrier' MO;
. Once the 'Baseband Transceiver' MO has its software activated, the
'Channel' MOs (one for each timeslot) indicate their state change as
well as software activation.
<<oml-msc-3>> shows:
. The 'Radio Carrier' MO Software Activation;
. The Request to the 'Baseband Transceiver' MO to establish the RSL
signalling connection to the BSC;
. Subsequent OPSTART and Change of Administrative State on the 'Baseband
Transceiver' MO;
. The following procedure takes place for each of the 'Channel' MOs:
.. Set the Channel Attributes (such as channel combination),
.. OPSTART,
.. change the Administrative State to Unlocked,
.. followed by a State Change Event Report with the new state.
. After all 'Channel' MOs are initialized, the Radio Carrier goes through
a similar procedure:
.. Set attributes,
.. OPSTART,
.. change Administrative State to Unlocked,
.. followed by a State Change Event Report with the new State (Enabled/OK)
. All 'Channel' MOs now also report their state as Enabled/OK.
. Finally, the BTS reports its state as Enabled/OK.

View File

@@ -0,0 +1,22 @@
msc {
bts [label="TRX"], bsc [label="BSC"];
bts => bsc [label="TCP Connect (Port 3003, RSL)"];
bts box bsc [label="IPA CCM Identification (Port 3003)"];
|||;
bts <= bsc [label="BCCH Information (SI1)"];
bts <= bsc [label="BCCH Information (SI2)"];
...;
bts <= bsc [label="BCCH Information (SI3)"];
bts <= bsc [label="BCCH Information (SI4)"];
|||;
bts <= bsc [label="SACCH FILLING (SI5)"];
...;
bts <= bsc [label="SACCH FILLING (SI6)"];
|||;
bts => bsc [label="RF Resource Indication"];
...;
bts => bsc [label="RF Resource Indication"];
...;
}

View File

@@ -0,0 +1,16 @@
msc {
bts [label="TRX"], bsc [label="BSC"];
bts => bsc [label="TCP Connect (Port 3003, RSL)"];
bts box bsc [label="IPA CCM Identification (Port 3003)"];
|||;
bts <= bsc [label="SACCH FILLING (SI5)"];
...;
bts <= bsc [label="SACCH FILLING (SI6)"];
|||;
bts => bsc [label="RF Resource Indication"];
...;
bts => bsc [label="RF Resource Indication"];
...;
}

View File

@@ -0,0 +1,56 @@
msc {
hscale = 2;
ms [label="MS"], bts [label="BTS"], bsc [label="BSC"], Msc [label="MSC"], mgw [label="MGW"];
ms => bts [label="L1 RACH burst"];
bts => bsc [label="RSL CHAN RQD"];
bts <= bsc [label="RSL CHAN ACT"];
bts => bsc [label="RSL CHAN ACT ACK"];
bts <= bsc [label="RSL IMM ASS CMD (RR IMM ASS)"];
ms <= bts [label="RR IMMEDIATE ASSIGN"];
ms => bts [label="LAPDm SABM (CM SERVICE REQ)"];
ms <= bts [label="LAPDm FIXME"];
bts => bsc [label="RSL ESTABLISH IND (CM SERVICE REQ)"];
bsc => Msc [label="CR (BSSAP COMPLETE L3 (CM SERVICE REQ))"];
...;
ms box Msc [label="MM Common Procedures (INFO, ID, AUTH, CIPH)"];
...;
ms => bts [label="CC SETUP"];
bts => bsc [label="RSL DATA IND (CC SETUP)"];
bsc => Msc [label="DT1 (DTAP (CC SETUP))"];
...;
ms box Msc [label="CC Signalling"];
...;
bsc <= Msc [label="BSSAP ASSIGNMENT CMD (TCH)"];
bts <= bsc [label="RSL IPA CRCX", id="1"];
bts => bsc [label="RSL IPA CRCX ACK (IP/Port @ BTS)"];
bsc => Msc [label="FIXME"];
Msc => mgw [label="FIXME"];
bts <- mgw [label="Start RTP + RTCP UDP Flows"];
bts <= bsc [label="RSL DATA REQ (RR CHAN MOD MODIFY)"];
ms <= bts [label="RR CHAN MOD MODIFY"];
ms => bts [label="RR CHAN MOD MODIFY ACK"];
bts => bsc [label="RSL DATA IND (RR CHAN MOD MODIFY ACK)"];
|||;
bts <= bsc [label="RSL MODE MODIFY REQ"];
bts => bsc [label="RSL MODE MODIFY ACK"];
Msc <= mgw [label="FIXME"];
bsc <= Msc [label="FIXME"];
bts <= bsc [label="RSL IPA MDCX (IP/Port @ MGW)", id="2"];
bts => bsc [label="RSL IPA MDCX ACK"];
bts -> mgw [label="Start RTP + RTCP UDP Flows"];
ms box mgw [label="Active Voice Call"];
bts => bsc [label="RSL MEAS RES"];
...;
bts <= bsc [label="RSL IPA DLCX"];
bts => bsc [label="RSL IPA DLCX ACK"];
bts -x mgw [label="Stop RTP + RTCP UDP Flows"];
bts <= bsc [label="RSL RF CHAN REL"];
bts => bsc [label="RSL RF CHAN REL ACK"];
}

980
doc/manuals/abis/rsl.adoc Normal file
View File

@@ -0,0 +1,980 @@
== Radio Signalling Link (RSL)
=== List of Messages
The following tables list the RSL messages used by OsmoBTS A-bis/IP,
grouped by their level of compliance with 3GPP TS 08.58.
==== Messages Compliant With TS 08.58
Specific additions and limitations apply, see the linked sections.
.Messages compliant with TS 08.58
[options="header",cols="10%,20%,45%,5%,20%"]
|===
| TS 08.58 § | This document § | Message | <-/-> | Received/Sent by OsmoBTS
5+<| *Radio link layer management messages*
| 8.3.1 | - | DATA REQUEST | <- | Received
| 8.3.2 | - | DATA INDICATION | -> | Sent
| 8.3.3 | - | ERROR INDICATION | -> | Sent
| 8.3.4 | - | ESTABLISH REQUEST | <- | Received
| 8.3.5 | - | ESTABLISH CONFIRM | -> | Sent
| 8.3.6 | - | ESTABLISH INDICATION | -> | Sent
| 8.3.7 | - | RELEASE REQUEST | <- | Received
| 8.3.8 | - | RELEASE CONFIRM | -> | Sent
| 8.3.9 | - | RELEASE INDICATION | -> | Sent
| 8.3.10 | - | UNIT DATA REQUEST | <- | Received
| 8.3.11 | - | UNIT DATA INDICATION | -> | Sent
5+<| *DEDICATED CHANNEL MANAGEMENT MESSAGES*
| 8.4.1 | <<CHANNEL_ACTIVATION>> | CHANNEL ACTIVATION | <- | Received
| 8.4.2 | <<CHANNEL_ACTIVATION>> | CHANNEL ACTIVATION ACKNOWLEDGE | -> | Sent
| 8.4.3 | <<CHANNEL_ACTIVATION>> | CHANNEL ACTIVATION NEGATIVE ACKNOWLEDGE | -> | Sent
| 8.4.4 | - | CONNECTION FAILURE INDICATION | -> | Sent
| 8.4.5 | - | DEACTIVATE SACCH | <- | Received
| 8.4.6 | - | ENCRYPTION COMMAND | <- | Received
| 8.4.7 | - | HANDOVER DETECTION | -> | Sent
| 8.4.8 | <<MEASUREMENT_RESULT>> | MEASUREMENT RESULT | -> | Sent
| 8.4.9 | <<MODE_MODIFY>> | MODE MODIFY | <- | Received
| 8.4.10 | - | MODE MODIFY ACKNOWLEDGE | -> | Sent
| 8.4.11 | - | MODE MODIFY NEGATIVE ACKNOWLEDGE | -> | Sent
| 8.4.14 | - | RF CHANNEL RELEASE | <- | Received
| 8.4.15 | <<MS_POWER_CONTROL>> | MS POWER CONTROL | <- | Received
| 8.4.16 | - | BS POWER CONTROL | <- | Received
| 8.4.19 | - | RF CHANNEL RELEASE ACKNOWLEDGE | -> | Sent
| 8.4.20 | <<SACCH_INFO_MODIFY>> | SACCH INFO MODIFY | <- | Received
5+<| *COMMON CHANNEL MANAGEMENT MESSAGES*
| 8.5.1 | <<BCCH_INFORMATION>> | BCCH INFORMATION | <- | Received
| 8.5.2 | - | CCCH LOAD INDICATION | -> | Sent
| 8.5.3 | <<CHANNEL_REQUIRED>> | CHANNEL REQUIRED | -> | Sent
| 8.5.4 | - | DELETE INDICATION | -> | Sent
| 8.5.5 | <<PAGING_COMMAND>> | PAGING COMMAND | <- | Received
| 8.5.6 | - | IMMEDIATE ASSIGN COMMAND | <- | Received
| 8.5.8 | - | SMS BROADCAST COMMAND | <- | Received
| 8.5.9 | - | CBCH LOAD INDICATION | -> | Sent
5+<| *TRX MANAGEMENT MESSAGES*
| 8.6.1 | <<RF_RESOURCE_INDICATION>> | RF RESOURCE INDICATION | -> | Sent
| 8.6.2 | <<SACCH_FILLING>> | SACCH FILLING | <- | Received
| 8.6.4 | - | ERROR REPORT | -> | Sent
|===
==== Messages Specific to OsmoBTS
.Messages specific to OsmoBTS, not found in 3GPP TS 08.58
[options="header",cols="15%,15%,45%,5%,20%"]
|===
2+| This document § | Message | <-/-> | Received/Sent by OsmoBTS
5+<| *User Plane Transport Management* (<<user_plane_txp_mgmt>>)
.3+.| <<rsl_crcx>> | <<rsl_crcx_msg>> | RSL Create Connection (CRCX) | <- | Received
| <<rsl_crcx_msg_ack>> | RSL Create Connection (CRCX) ACK | -> | Sent
| <<rsl_crcx_msg_nack>> | RSL Create Connection (CRCX) NACK | -> | Sent
.3+.| <<rsl_mdcx>> | <<rsl_mdcx_msg>> | RSL Modify Connection (MDCX) | <- | Received
| <<rsl_mdcx_msg_ack>> | RSL Modify Connection (MDCX) ACK | -> | Sent
| <<rsl_mdcx_msg_nack>> | RSL Modify Connection (MDCX) NACK | -> | Sent
.3+.| <<rsl_dlcx>> | <<rsl_dlcx_msg>> | RSL Delete Connection (DLCX) | <- | Received
| <<rsl_dlcx_msg_ack>> | RSL Delete Connection (DLCX) ACK | -> | Sent
| <<rsl_dlcx_msg_nack>> | RSL Delete Connection (DLCX) NACK | -> | Sent
| <<rsl_dlcx_ind>> | <<rsl_dlcx_ind_msg>> | RSL Delete Connection (DLCX) Indication | -> | Sent
5+<| *IPA style PDCH Management* (<<ipa_style_pdch_mgmt>>)
.3+.| <<pdch_act>> | <<rsl_pdch_act>> | RSL PDCH Activation | <- | Received
| <<rsl_pdch_act_ack>> | RSL PDCH Activation ACK | -> | Sent
| <<rsl_pdch_act_nack>> | RSL PDCH Activation NACK | -> | Sent
.3+.| <<pdch_deact>> | <<rsl_pdch_deact>> | RSL PDCH Deactivation | <- | Received
| <<rsl_pdch_deact_ack>> | RSL PDCH Deactivation ACK | -> | Sent
| <<rsl_pdch_deact_nack>> | RSL PDCH Deactivation NACK | -> | Sent
5+<| *COMMON CHANNEL MANAGEMENT MESSAGES*
.3+.| <<etws>> | <<OSMO_ETWS_CMD>> | Osmocom ETWS Command | <- | Received
|===
==== Messages Not Implemented by OsmoBTS
.3GPP TS 08.58 messages not implemented by OsmoBTS
[options="header",cols="10%,90%"]
|===
| TS 08.58 § | Message
2+<| *DEDICATED CHANNEL MANAGEMENT MESSAGES*
| 8.4.12 | PHYSICAL CONTEXT REQUEST
| 8.4.13 | PHYSICAL CONTEXT CONFIRM
| 8.4.17 | PREPROCESS CONFIGURE
| 8.4.18 | PREPROCESSED MEASUREMENT RESULT
| 8.4.21 | TALKER DETECTION
| 8.4.22 | LISTENER DETECTION
| 8.4.23 | REMOTE CODEC CONFIGURATION REPORT
| 8.4.24 | ROUND TRIP DELAY REPORT
| 8.4.25 | PRE-HANDOVER NOTIFICATION
| 8.4.26 | MULTIRATE CODEC MODIFICATION REQUEST
| 8.4.27 | MULTIRATE CODEC MODIFICATION ACKNOWLEDGE
| 8.4.28 | MULTIRATE CODEC MODIFICATION NEGATIVE ACKNOWLEDGE
| 8.4.29 | MULTIRATE CODEC MODIFICATION PERFORMED
| 8.4.30 | TFO REPORT
| 8.4.31 | TFO MODIFICATION REQUEST
2+<| *COMMON CHANNEL MANAGEMENT MESSAGES*
| 8.5.7 | SMS BROADCAST REQUEST
| 8.5.10 | NOTIFICATION COMMAND
2+<| *TRX MANAGEMENT MESSAGES*
| 8.6.3 | OVERLOAD
2+<| *LOCATION SERVICES MESSAGES*
| 8.7.1 | LOCATION INFORMATION
|===
=== Message Limitation Details
[[CHANNEL_ACTIVATION]]
==== Channel Activation
When used on a timeslot using the non-standard channel combination
'NM_CHANC_OSMO_TCHFull_TCHHalf_PDCH' as configured by OML, the regular
RSL channel activation procedures can not only be used for activation
of circuit-switched channels, but also for activation of a PDCH.
See <<OSMOCOM_DYN_TS>>.
NOTE:: Do not confuse this with the IPA style _PDCH ACT_ type
dynamic PDCH protocol employed by nanoBTS devices (<<ipa_style_pdch_mgmt>>).
[[MEASUREMENT_RESULT]]
==== Measurement Result
Conforms to 3GPP TS 08.58 § 8.4.8 with this limitation:
._Measurement Result_ IE limitations
[options="header",cols="10%,30%,60%"]
|===
| TS 08.58 § | IE Name | Handling
| 9.3.37 | MS Timing Offset | never sent by OsmoBTS
|===
[[MODE_MODIFY]]
==== Mode Modify
Conforms to 3GPP TS 08.58 § 8.4.9 with these limitations:
._Mode Modify_ IE limitations
[options="header",cols="10%,30%,60%"]
|===
| TS 08.58 § | IE Name | Handling
| 9.3.45 | Main channel reference | _ignored_
| 9.3.53 | MultiRate Control | _ignored_
| 9.3.54 | Supported Codec Types | _ignored_
|===
[[MS_POWER_CONTROL]]
==== MS Power Control
Conforms to 3GPP TS 08.58 § 8.4.15 with these limitations:
._MS Power Control_ IE limitations
[options="header",cols="10%,30%,60%"]
|===
| TS 08.58 § | IE Name | Handling
| 9.3.31 | MS Power Parameters | _ignored_
|===
[[SACCH_INFO_MODIFY]]
==== SACCH Info Modify
Conforms to 3GPP TS 08.58 § 8.4.20, with these exceptions:
._SACCH Info Modify_ IE limitations
[options="header",cols="10%,30%,60%"]
|===
| TS 08.58 § | IE Name | Handling
| 9.3.30 | System Info Type | See below for available types
| 9.3.23 | Starting Time | not supported, provokes an _Error Report_ response
|===
._System Info Type_ values that can occur on the SACCH
[options="header",width="50%",cols="20%,80%"]
|===
| Value | Name
| 0x05 | RSL_SYSTEM_INFO_5
| 0x06 | RSL_SYSTEM_INFO_6
| 0x0d | RSL_SYSTEM_INFO_5bis
| 0x0e | RSL_SYSTEM_INFO_5ter
| 0x47 | RSL_EXT_MEAS_ORDER
| 0x48 | RSL_MEAS_INFO
|===
[[BCCH_INFORMATION]]
==== BCCH Information
Conforms to 3GPP TS 08.58 § 8.5.1, with these limitations and extensions:
._BCCH Information_ IE details
[options="header",cols="10%,30%,60%"]
|===
| TS 08.58 § | IE Name | Handling
| 9.3.30 | System Info Type | See <<SACCH_INFO_MODIFY>> for available types
| 9.3.11 | L3 Info | This IE may be included instead of a 9.3.39 _Full BCCH Info_ IE.
The _Full BCCH Info_ takes precedence over _L3 Info_.
To stop SI transmission, both of these IEs must be omitted.
|===
[[CHANNEL_REQUIRED]]
==== Channel Required
Conforms to 3GPP TS 08.58 § 8.5.3, with these limitations:
._Channel Required_ message IE details
[options="header",cols="10%,30%,60%"]
|===
| TS 08.58 § | IE Name | Handling
| 9.3.16 | Physical Context | never sent by OsmoBTS
|===
[[PAGING_COMMAND]]
==== Paging Command
Conforms to 3GPP TS 08.58 § 8.5.5, with these limitations:
._Paging Command_ message IE details
[options="header",cols="10%,30%,60%"]
|===
| TS 08.58 § | IE Name | Handling
| 9.3.49 | eMLPP Priority | _ignored_
|===
NOTE: If adding the identity to the paging queue fails, the BSC is not notified
in any way.
[[RF_RESOURCE_INDICATION]]
==== RF Resource Indication
This message does not conform to 3GPP TS 08.58 § 8.6.1, in that it omits the
_Resource Information_ IE that would contain the actual payload data, which
renders this message void.
._RF Resource Indication_ message IE exceptions
[options="header",cols="10%,30%,60%"]
|===
| TS 08.58 § | IE Name | Handling
| 9.3.21 | Resource Information | OsmoBTS omits this IE, though TS 08.58
specifies it as mandatory.
|===
[[SACCH_FILLING]]
==== SACCH Filling
Conforms to 3GPP TS 08.58 § 8.6.2, with these limitations:
._SACCH Filling_ message IE limitations
[options="header",cols="10%,30%,60%"]
|===
| TS 08.58 § | IE Name | Handling
| 9.3.30 | System Info Type | See <<SACCH_INFO_MODIFY>> for available types
| 9.3.23 | Starting Time | _ignored_
|===
[[user_plane_txp_mgmt]]
=== User Plane Transport Management
This chapter defines the A-bis/IP specific RSL procedures that are
introduced in addition to the 3GPP TS 08.58 standard procedures.
In classic A-bis over E1, user plane traffic is carried over 16kBps
sub-slots of 64kBps E1 time-slots according to ETSI/3GPP TS 08.60. As
the E1 line is a dedicated line between BTS and BSC, no further
addressing information is required.
In A-bis/IP as described by the present document, new RSL procedures
have been introduced to deal with the different properties of
the underlying IP based transport medium.
[[rsl_crcx]]
==== RSL Create Connection (CRCX)
This procedure is used by the BSC to request the BTS to allocate + bind
to a BTS-local UDP port for the subsequent transmission of user-plane
data via RTP.
To do so, the BSC sends the *Create Connection (CRCX)* message. In case of
successful outcome, the BTS responds with *Create Connection (CRCX)
ACK*. In case of any error, the BTS responds with *Create Connection
(CRCX) NACK*.
See <<rsl_crcx_msg>>, <<rsl_crcx_msg_ack>>, <<rsl_crcx_msg_nack>>
[[rsl_mdcx]]
==== RSL Modify Connection (MDCX)
This procedure is used by the BSC to request the BTS to modify an
already-bound BTS-local UDP port for user-plane RTP. It is used in
particular to configure the remote IP address and UDP port to which the
BTS shall send user-plane RTP traffic. This remote address is normally
either a Media Gateway (MGW) of some sort, but could also be the RTP
socket of the corresponding other leg of a mobile-to-mobile call.
To modify a user-plane connection, the BSC sends the *Modify Connection*
message. In case of successful outcome, the BTS responds with
*Modify Connection (MDCX) ACK*. In case of any error, the BTS responds
with *Modify Connection (MDCX) NACK*.
See <<rsl_mdcx_msg>>, <<rsl_mdcx_msg_ack>>, <<rsl_mdcx_msg_nack>>
[[rsl_dlcx]]
==== RSL Delete Connection (DLCX)
This procedure is used by the BSC to request the BTS to delete an
already-existing BTS-local UDP port for user-plane RTP.
To delete a user-plane connection, the BSC sends the *Delete Connection
(DLCX)* message. In case of successful outcome, the BTS responds with
*Delete Connection (DLCX) ACK*. In case of any error, the BTS responds
with *Delete Connection (DLCX) NACK*.
See <<rsl_dlcx_msg>>, <<rsl_dlcx_msg_ack>>, <<rsl_dlcx_msg_nack>>
[[rsl_dlcx_ind]]
==== RSL Delete Connection (DLCX) Indication
When a BTS-local UDP connection for user-plane RTP is automatically
released at the time of RF CHANNEL RELEASE, the BTS sends a unilateral,
non-acknowledged *RSL Delete Connection (DLCX) Indication* to the BSC.
See <<rsl_dlcx_ind_msg>>
[[rsl-dynamic-channels]]
=== Dynamic Channel Combinations
In the classic data model established by ETSI/3GPP for A-bis, each
timeslot (channel) is configured using a static channel combination by
means of A-bis OML. Particularly in presence of GPRS services, this
is very inflexible and leads to inefficient use of air interface
resources.
As such, several methods have been implemented to overcome this
limitation. The fundamental operation can be outlined like this:
* Configuration of a particular _dynamic_ channel combination via OML
* activation of TCH works like on a classic TCH channel combination
* activation of PDCH requires some specific PDCH activation procedure
There are two variants implemented in the OsmoBTS A-bis dialect:
[[ipa_style_pdch_mgmt]]
==== IPA Style Dynamic Channels
This method is used when OML uses 'NM_CHANC_IPAC_TCHFull_PDCH' (0x80)
as channel combination for the given time-slot.
'IPA style' refers to 'ip.access' compatible PDCH activation and deactivation.
When the IPA style dynamic channel combination _TCH/F or PDCH_
is set, the non-standard 'PDCH ACTIVATE' (<<pdch_act>>) and 'PDCH
DEACTIVATE' (<<pdch_deact>>) procedures are used for switching an idle
channel into PDCH mode and back into idle mode.
When the channel is used as TCH/F, regular circuit-switched activation
is performed, like on any traditional TCH/F. However, the BSC must
make sure to first disable the PDCH on the timeslot, before activating
it as TCH/F. Likewise, any circuit-switched TCH/F on the channel must
be deactivated using standard RSL signalling, before the specific PDCH
related procedures are used to enable the PDCH.
[[pdch_act]]
===== PDCH Activate
This procedure is used by the BSC to request the BTS to activate an
IPA style dynamic TCH/F+PDCH channel in PDCH mode.
The operation is not supported on any other physical channel type.
See <<rsl_pdch_act>>, <<rsl_pdch_act_ack>>, <<rsl_pdch_act_nack>>
[[pdch_deact]]
===== PDCH Deactivate
This procedure is used by the BSC to request the BTS to deactivate an
active PDCH on any an IPA style dynamic TCH/F+PDCH channel.
The operation is not supported on any other physical channel type.
See <<rsl_pdch_deact>>, <<rsl_pdch_deact_ack>>, <<rsl_pdch_deact_nack>>
===== IPA Style Dynamic Switchover Example
.Part 1: example for dynamic channel switchover, for IPA style dynamic timeslots
["mscgen"]
----
include::dyn_ts_ipa_style1.msc[]
----
.Part 2: example for dynamic channel switchover, for IPA style dynamic timeslots
["mscgen"]
----
include::dyn_ts_ipa_style2.msc[]
----
[[OSMOCOM_DYN_TS]]
==== Osmocom Style Dynamic Channels
This method is in use when OML uses
'NM_CHANC_OSMO_TCHFull_TCHHalf_PDCH' (0x90) for the given time-slot.
The activation of PDCH is performed by using the regular 'RSL CHANNEL ACTIVATE'
procedure according to <<CHANNEL_ACTIVATION>>, with these modifications:
* The 'C-bits' part of the 'Channel Number' IE take the non-standard binary
value 11000 (C5 thru C1 as seen in 3GPP TS 08.58 § 9.3.1).
* The 'A-bits' part of the 'Activation Type' IE take the non-standard binary
value 1111, with an additional fourth bit (add A4 to A3 thru A1 as seen in
3GPP TS 08.58 § 9.3.3; all remaining reserved bits as well as the 'R' bit are
coded as zero).
* The normally mandatory 'Channel Mode' IE is omitted; none of the optional IEs
are included.
Hence the message consists of exactly these IEs:
.PDCH type _Channel Activation_ message IEs
[options="header",cols="10%,30%,60%"]
|===
| TS 08.58 § | IE Name | Handling
| 9.1 | Message discriminator | Dedicated Channel Management
| 9.2 | Message type | CHANnel ACTIVation
| 9.3.1 | Channel number | 'C-bits' 11000, plus TS bits as usual
| 9.3.3 | Activation type | 'A-bits' 1111
|===
===== Osmocom Style Dynamic Switchover Example
.Part 1: example for dynamic channel switchover, for Osmocom style dynamic timeslots
["mscgen"]
----
include::dyn_ts_osmocom_style1.msc[]
----
.Part 2: example for dynamic channel switchover, for Osmocom style dynamic timeslots
["mscgen"]
----
include::dyn_ts_osmocom_style2.msc[]
----
[[etws]]
=== ETWS (Earthquake and Tsunami Warning System)
ETWS as specified in 3GPP TS 23.041 includes not only notification via
SMSCB, but also so-called Primary Notifications (PN). The ETWS PN are
transmitted
* by the BSC to all subscribers with active dedicated channels
* by the BTS on the PCH to all subscribers in idle mode
* by the PCU on the PACCH to all subscribers with active TBF
Unfortunately, 3GPP forgot to update their specifications with any
information as to how the ETWS PN is transmitted from BSC to BTS in
a portable way, and Osmocom had to invent their own non-standard
signaling for it.
See <<OSMO_ETWS_CMD>> for the Osmocom implementation.
=== Message Formats and Contents
[[rsl_crcx_msg]]
==== Create Connection (CRCX)
This message is sent by the BSC to the BTS to request the
creation of a user-plane RTP connection for the specified *Channel
number*.
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1
| Channel number | 08.58 9.3.1 | M | TV | 2
| Destination IP Address | <<RSL_IE_IPAC_REMOTE_IP>> | O | TV | 5
| Destination IP Port | <<RSL_IE_IPAC_REMOTE_PORT>> | O | TV | 3
| IP Speech Mode | <<RSL_IE_IPAC_SPEECH_MODE>> | O | TV | 2
| RTP Payload Type 2 | <<RSL_IE_IPAC_RTP_PAYLOAD2>> | O | TV | 2
|===
[[rsl_crcx_msg_ack]]
==== Create Connection (CRCX) ACK
This message is sent by the BTS to the BSC to acknowledge the
successful outcome of creating a user-plane RTP connection. It is sent
in response to the *Create Connection (CRCX)*.
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1
| Channel number | 08.58 9.3.1 | M | TV | 2
| Connection Id | <<RSL_IE_IPAC_CONN_ID>> | M | TV | 3
| Source IP Address | <<RSL_IE_IPAC_LOCAL_IP>> | O | TV | 5
| Source IP Port | <<RSL_IE_IPAC_LOCAL_PORT>> | O | TV | 3
| RTP Payload Type 2 | <<RSL_IE_IPAC_RTP_PAYLOAD2>> | O | TV | 2
|===
[[rsl_crcx_msg_nack]]
==== Create Connection (CRCX) NACK
This message is sent by the BTS to the BSC to signal the
unsuccessful outcome of creating a user-plane RTP connection. It is
sent in response to the *Create Connection (CRCX)*.
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1
| Channel number | 08.58 9.3.1 | M | TV | 2
| Destination IP Address | <<RSL_IE_IPAC_REMOTE_IP>> | O | TV | 5
| Destination IP Port | <<RSL_IE_IPAC_REMOTE_PORT>> | O | TV | 3
| Cause | 08.58 9.3.26 | O | TLV | >= 3
|===
[[rsl_mdcx_msg]]
==== Modify Connection (MDCX)
This message is sent by the BSC to the BTS to modify the
properties of a user-plane RTP connection.
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1
| Channel number | 08.58 9.3.1 | M | TV | 2
| Connection Id | <<RSL_IE_IPAC_CONN_ID>> | O | TV | 3
| Destination IP Address | <<RSL_IE_IPAC_REMOTE_IP>> | O | TV | 5
| Destination IP Port | <<RSL_IE_IPAC_REMOTE_PORT>> | O | TV | 3
| IP Speech Mode | <<RSL_IE_IPAC_SPEECH_MODE>> | O | TV | 2
| RTP Payload Type 2 | <<RSL_IE_IPAC_RTP_PAYLOAD2>> | O | TV | 2
|===
[[rsl_mdcx_msg_ack]]
==== Modify Connection (MDCX) ACK
This message is sent by the BTS to the BSC to acknowledge the
successful modification of a user-plane RTP connection. It is sent in
response to a *Modify Connection (MDCX)*
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1
| Channel number | 08.58 9.3.1 | M | TV | 2
| Connection Id | <<RSL_IE_IPAC_CONN_ID>> | O | TV | 3
| Source IP Address | <<RSL_IE_IPAC_LOCAL_IP>> | C | TV | 5
| Source IP Port | <<RSL_IE_IPAC_LOCAL_PORT>> | C | TV | 3
| RTP Payload Type 2 | <<RSL_IE_IPAC_RTP_PAYLOAD2>> | O | TV | 2
|===
[[rsl_mdcx_msg_nack]]
==== Modify Connection (MDCX) NACK
This message is sent by the BTS to the BSC to signal the
unsuccessful outcome of modifying the user-plane RTP connection for the
specified Channel number. It is sent in response to the *Modify
Connection (MDCX)*.
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1
| Channel number | 08.58 9.3.1 | M | TV | 2
| Cause | 08.58 9.3.26 | M | TLV | >= 3
|===
[[rsl_dlcx_ind_msg]]
==== Delete Connection (DLCX) Indication
This message is sent by the BTS to indicate the automatic
deletion of a BTS-local UDP connection for user-plane RTP traffic at the
time of RF Channel release.
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1
| Channel number | 08.58 9.3.1 | M | TV | 2
| Connection Id | <<RSL_IE_IPAC_CONN_ID>> | M | TV | 3
| Connection Id | <<RSL_IE_IPAC_CONN_STAT>> | M | TV | 3
| Cause | 08.58 9.3.26 | M | TLV | >= 3
|===
[[rsl_dlcx_msg]]
==== Delete Connection (DLCX)
This message is sent by the BSC to the BTS to request the
disconnection of a user-plane RTP connection for the specified Channel
number.
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1
| Channel number | 08.58 9.3.1 | M | TV | 2
| Connection Id | <<RSL_IE_IPAC_CONN_ID>> | O | TV | 3
|===
[[rsl_dlcx_msg_ack]]
==== Delete Connection (DLCX) ACK
This message is sent by the BTS to signal the successful
outcome of deleting the user-plane RTP connection for the specified
Channel number. It is sent in response to the *Delete Connection
(DLCX)*.
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1
| Channel number | 08.58 9.3.1 | M | TV | 2
| Connection Id | <<RSL_IE_IPAC_CONN_ID>> | O | TV | 3
| Connection Statistics | <<RSL_IE_IPAC_CONN_STAT>> | C | TV | 29
|===
[[rsl_dlcx_msg_nack]]
==== Delete Connection (DLCX) NACK
This message is sent by the BTS to signal the unsuccessful
outcome of deleting the user-plane RTP connection for the specified
Channel number. It is sent in response to the *Delete Connection
(DLCX)*.
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1
| Channel number | 08.58 9.3.1 | M | TV | 2
| Connection Id | <<RSL_IE_IPAC_CONN_ID>> | O | TV | 3
| Cause | 08.58 9.3.26 | M | TLV | >= 3
|===
[[rsl_pdch_act]]
==== PDCH Activate
This message is sent by the BSC to request the activation of a PDCH on
a IPA style dynamic TCH/F+PDCH channel.
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1
| Channel number | 08.58 9.3.1 | M | TV | 2
|===
NOTE:: This message is *not* used by Osmocom style dynamic channels
[[rsl_pdch_act_ack]]
==== PDCH Activate ACK
This message is sent by the BTS to confirm the successful activation
of a PDCH on a IPA style dynamic TCH/F+PDCH channel.
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1
| Channel number | 08.58 9.3.1 | M | TV | 2
| Frame Number | 08.58 9.3.8 | O | TV | 3
|===
NOTE:: This message is *not* used by Osmocom style dynamic channels
[[rsl_pdch_act_nack]]
==== PDCH Activate NACK
This message is sent by the BTS to reject the successful activation
of a PDCH on a IPA style dynamic TCH/F+PDCH channel.
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1
| Channel number | 08.58 9.3.1 | M | TV | 2
| Cause | 08.58 9.3.26 | M | TLV | >= 3
|===
NOTE:: This message is *not* used by Osmocom style dynamic channels
[[rsl_pdch_deact]]
==== PDCH Deactivate
This message is sent by the BSC to request the deactivation of a PDCH
on a IPA style dynamic TCH/F+PDCH channel.
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1
| Channel number | 08.58 9.3.1 | M | TV | 2
|===
NOTE:: This message is *not* used by Osmocom style dynamic channels
[[rsl_pdch_deact_ack]]
==== PDCH Deactivate ACK
This message is sent by the BTS to confirm the successful deactivation
of a PDCH on a IPA style dynamic TCH/F+PDCH channel.
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1
| Channel number | 08.58 9.3.1 | M | TV | 2
|===
NOTE:: This message is *not* used by Osmocom style dynamic channels
[[rsl_pdch_deact_nack]]
==== PDCH Deactivate NACK
This message is sent by the BTS to reject the deactivation of a PDCH
on a IPA style dynamic TCH/F+PDCH channel.
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1
| Channel number | 08.58 9.3.1 | M | TV | 2
| Cause | 08.58 9.3.26 | M | TLV | >= 3
|===
NOTE:: This message is *not* used by Osmocom style dynamic channels
[[OSMO_ETWS_CMD]]
==== Osmocom ETWS Command
This message is sent by the BSC to transfer the ETWS Primary Notification (PN)
from BSC to BTS and enable/disable transmission of ETWS PN by the BTS. For more
information about ETWS, see 3GPP TS 23.041.
If the ETWS PN length is > 0, the BTS will immediately start transmission
of the received ETWS PN on the PCH using P1 Rest Octets. It will also forward
he ETWS PN to the PCU to enable the PCU to transmit it via PACCH on active TBF.
If the ETWS PN length is 0, the BTS will stop any ETWS PN broadcast via the PCH.
The Channel Number IE is set to the Downlink CCCH (PCH).
[options="header"]
[cols="30%,25%,15%,15%,15%"]
|===
| INFORMATION ELEMENT | REFERENCE | PRESENCE | FORMAT | LENGTH
| Message discriminator | 08.58 9.1 | M | V | 1
| Message type | <<own_msg_types>> | M | V | 1
| Channel number | 08.58 9.3.1 | M | TV | 2
| SMSCB Message | 08.58 9.3.42 | M | TLV | 2-58
|===
=== Information Element Codings
[[own_msg_types]]
==== A-bis/IP specific RSL Message discriminators
The following message discriminators are used in addition to those
indicated in 3GPP TS 08.58 Section 9.1:
.OsmoBTS specific new message discriminators
[options="header",cols="10%,50%,40%"]
|===
| Message Type | Message | This document §
| 0x70 | Create Connection (CRCX) | <<rsl_crcx_msg>>
| 0x71 | Create Connection (CRCX) ACK | <<rsl_crcx_msg_ack>>
| 0x72 | Create Connection (CRCX) NACK | <<rsl_crcx_msg_nack>>
| 0x73 | Modify Connection (MDCX) | <<rsl_mdcx_msg>>
| 0x74 | Modify Connection (MDCX) ACK | <<rsl_mdcx_msg_ack>>
| 0x75 | Modify Connection (MDCX) NACK | <<rsl_mdcx_msg_nack>>
| 0x76 | Delete Connection (DLCX) Indication | <<rsl_dlcx_ind_msg>>
| 0x77 | Delete Connection (DLCX) | <<rsl_dlcx_msg>>
| 0x78 | Delete Connection (DLCX) ACK | <<rsl_dlcx_msg_ack>>
| 0x79 | Delete Connection (DLCX) NACK | <<rsl_dlcx_msg_nack>>
| 0x7f | Osmocom ETWS Command | <<OSMO_ETWS_CMD>>
| 0x48 | PDCH Activate | <<rsl_pdch_act>>
| 0x49 | PDCH Activate ACK | <<rsl_pdch_act_ack>>
| 0x4a | PDCH Activate NACK | <<rsl_pdch_act_nack>>
| 0x4b | PDCH Deactivate | <<rsl_pdch_deact>>
| 0x4c | PDCH Deactivate ACK | <<rsl_pdch_deact_ack>>
| 0x4d | PDCH Deactivate NACK | <<rsl_pdch_deact_nack>>
|===
==== A-bis/IP specific RSL IEIs
The following Information Element Identifiers (IEIs) are used in
addition to those indicated in 3GPP TS 08.58 Section 9.3:
.A-bis/IP specific information elements
[options="header",cols="10%,50%,40%"]
|===
| IEI | Name | This document §
| 0x01 | RSL_IE_CHAN_NR | <<RSL_IE_CHAN_NR>>
| 0xf0 | RSL_IE_IPAC_REMOTE_IP | <<RSL_IE_IPAC_REMOTE_IP>>
| 0xf1 | RSL_IE_IPAC_REMOTE_PORT | <<RSL_IE_IPAC_REMOTE_PORT>>
| 0xf3 | RSL_IE_IPAC_LOCAL_PORT | <<RSL_IE_IPAC_LOCAL_PORT>>
| 0xf4 | RSL_IE_IPAC_SPEECH_MODE | <<RSL_IE_IPAC_SPEECH_MODE>>
| 0xf5 | RSL_IE_IPAC_LOCAL_IP | <<RSL_IE_IPAC_LOCAL_IP>>
| 0xf6 | RSL_IE_IPAC_CONN_STAT | <<RSL_IE_IPAC_CONN_STAT>>
| 0xf8 | RSL_IE_IPAC_CONN_ID | <<RSL_IE_IPAC_CONN_ID>>
| 0xfc | RSL_IE_IPAC_RTP_PAYLOAD2 | <<RSL_IE_IPAC_RTP_PAYLOAD2>>
|===
[[RSL_IE_CHAN_NR]]
==== RSL_IE_CHAN_NR
This information element is coded like 3GPP TS 08.58 Section 9.3.1,
but in addition supports the following extended coding:
* C5..C1 bits 0b11000 for PDCH type channels
The TN-Bits are not re-defined in this case but use the same encoding
as specified in TS 08.58 Section 9.3.1.
NOTE:: The above extension is only valid on an Osmocom-style dynamic
channel, having configured the 'NM_CHANC_IPAC_TCHFull_PDCH' channel
combination by OML.
[[RSL_IE_IPAC_REMOTE_IP]]
==== RSL_IE_IPAC_REMOTE_IP
This information element contains the remote (MGW side) IPv4 address in
network byte order. It is encoded as fixed-size element with one byte
IEI followed by four bytes IPv4 address.
[[RSL_IE_IPAC_REMOTE_PORT]]
==== RSL_IE_IPAC_REMOTE_PORT
This information element contains the remote (MGW side) UDP port in
network byte order. It is encoded as fixed-size element with one byte
IEI followed by two bytes UDP port number.
[[RSL_IE_IPAC_LOCAL_PORT]]
==== RSL_IE_IPAC_LOCAL_PORT
This information element contains the local (BTS side) IPv4 address in
network byte order. It is encoded as fixed-size element with one byte
IEI followed by two bytes UDP port number.
[[RSL_IE_IPAC_SPEECH_MODE]]
==== RSL_IE_IPAC_SPEECH_MODE
This information element encodes the speech mode. It is set according
to the voice codec used on the connection. It is encoded as a fixed-size
element of two bytes, with one byte IEI followed by one byte Speech mode
indicator.
.A-bis/IP Speech Mode Indicator Values
[options="header",width="40%",cols="20%,80%"]
|===
| Value | Description
| 0x00 | TCH/F with FR codec
| 0x01 | TCH/F with EFR codec
| 0x02 | TCH/F with AMR codec
| 0x03 | TCH/H with HR codec
| 0x05 | TCH/H with AMR codec
|===
[[RSL_IE_IPAC_LOCAL_IP]]
==== RSL_IE_IPAC_LOCAL_IP
This information element contains the local (BTS side) IPv4 address in
network byte order. It is encoded as fixed-size element with one byte
IEI followed by four bytes IPv4 address.
[[RSL_IE_IPAC_CONN_STAT]]
==== RSL_IE_IPAC_CONN_STAT
This information element contains statistics about the RTP connection.
It is encoded as 29 bytes, with the first byte as IEI and 28 bytes
fixed-length payload encoded as follows:
.A-bis/IP Connection Statistics
[options="header",width="60%",cols="15%,15%,70%"]
|===
| Offset | Size | Description
| 0 | 4 | Total number of RTP packets sent
| 4 | 4 | Total number of octets sent
| 8 | 4 | Total number of RTP packets received
| 12 | 4 | Total number of octets received
| 16 | 4 | Total number of lost packets in Rx direction
| 20 | 4 | Inter-arrival Jitter
| 24 | 4 | Average transmission delay
|===
All the above values are encoded in network byte order.
A detailed definition of the individual values is given in RFC 1889.
[[RSL_IE_IPAC_CONN_ID]]
==== RSL_IE_IPAC_CONN_ID
This IE is a TV with a value length of two bytes. The value is a 16 bit
connection ID in network byte order.
[[RSL_IE_IPAC_RTP_PAYLOAD2]]
==== RSL_IE_IPAC_RTP_PAYLOAD2
This information element contains the RTP payload identifier, which is
used in the PT (Payload Type) field of the RTP header in subsequent
transmissions of the RTP flow.
=== A-bis RSL Initialization / BTS bring-up
Upon receiving the 'IPA RSL CONNECT' OML message by the respective
'Baseband Transceiver' MO, the BTS proceeds with establishing a separate
TCP connection for the given TRX.
[[rsl-msc-pri]]
.A-bis RSL BTS bring-up for primary TRX
["mscgen"]
----
include::rsl-startup-pri.msc[]
----
[[rsl-msc-sec]]
.A-bis RSL BTS bring-up for secondary TRXs
["mscgen"]
----
include::rsl-startup-sec.msc[]
----
The initialization of the primary and secondary TRX slightly differ, as
illustrated by the differences of <<rsl-msc-pri>> and <<rsl-msc-sec>>.
Since the secondary TRX has no BCCH, it does not (need to) receive any 'RSL
BCCH INFORMATION' messages from the BSC.

33
doc/manuals/abis/rtp.adoc Normal file
View File

@@ -0,0 +1,33 @@
== User-Plane Traffic via RTP
RTP (Realtime Transfer Protocol) is a protocol for streaming audio
and video data. It is specified by IETF RFC 1889.
OsmoBTS A-bis/IP implements RTP as transport medium for circuit-switched
user-plane traffic, contrary to the E1 sub-slot based transport
specified in 3GPP TS 08.60.
The RTP transport endpoint parameters are configured using the RSL User
Plane Transport Management procedures described in <<user_plane_txp_mgmt>>.
RTCP is implemented in addition to RTP, on a UDP port number of the RTP
port incremented by one.
=== RTP Payload Formats
The RTP payload format depends on the voice codec used on the radio
channel. The OsmoBTS is simply passing the GSM speech frames between
the Um radio interface channels and the RTP payload (and vice-versa).
No transcoding function is implemented in the BTS!
.RTP Payload formats
[options="header",width="60%",cols="15%,15%,70%"]
|===
| TCH | Codec | RTP payload format specification
| TCH/F | FR | IETF RFC 3551 Section 4.5.8
| TCH/F | EFR | IETF RFC 3551 Section 4.5.9
| TCH/F | AMR | IETF RFC 4867
| TCH/H | HR | IETF RFC 5993
| TCH/H | AMR | IETF RFC 4867
|===

View File

@@ -0,0 +1,120 @@
== OsmoBTS software architecture
=== OsmoBTS PHY interface abstraction
The OsmoBTS PHY interface serves as an internal abstraction layer
between given PHY hardware (as provided by the bts_model) and the actual
logical transceivers (TRXs) of a BTS inside the OsmoBTS code base.
==== PHY link
A PHY link is a physical connection / link towards a given PHY. This
might be, for example,
* a set of file descriptors to device nodes in the /dev/ directory
(sysmobts, litecell15)
* a packet socket for sending raw Ethernet frames to an OCTPHY
* a set of UDP sockets for interacting with OsmoTRX
Each PHY interface has a set of attribute/parameters and a list of 1 to
n PHY instances.
PHY links are numbered 0..n globally inside OsmoBTS.
Each PHY link is configured via the VTY using its individual top-level
vty node. Given the different bts-model / phy specific properties, the
VTY configuration options (if any) of the PHY instance differ between
BTS models.
The PHY links and instances must be configured above the BTS/TRX nodes
in the configuration file. If the file is saved via the VTY, the code
automatically ensures this.
==== PHY instance
A PHY instance is an instance of a PHY, accessed via a PHY link.
In the case of osmo-bts-sysmo and osmo-bts-trx, there is only one
instance in every PHY link. This is due to the fact that the API inside
that PHY link does not permit for distinguishing multiple different
logical TRXs.
Other PHY implementations like the OCTPHY however do support addressing
multiple PHY instances via a single PHY link.
PHY instances are numbered 0..n inside each PHY link.
Each PHY instance is configured via the VTY as a separate node beneath each
PHY link. Given the different bts-model / phy specific properties, the
VTY configuration options (if any) of the PHY instance differ between
BTS models.
==== Mapping PHY instances to TRXs
Each TRX node in the VTY must use the 'phy N instance M' command in
order to specify which PHY instance is allocated to this specific TRX.
=== Internal control flow
==== start-up / sequencing during OsmoBTS start
.Control flow at OsmoBTS start-up procedure
[options="header",cols="10%,35%,55%"]
|===
| section | function | description
| bts-specific | main() | Entering main() from glibc
| common | bts_main() | initialization of talloc contexts
| common | bts_log_init() | initialization of logging
| common | handle_options() | common option parsing
| bts-specific | bts_model_handle_options() | model-specific option parsing
| common | gsm_bts_alloc() | allocation of BTS/TRX/TS data structures
| common | vty_init() | Initialziation of VTY core, libosmo-abis and osmo-bts VTY
| common | main() | Setting of scheduler RR priority (if configured)
| common | main() | Initialization of GSMTAP (if configured)
| common | bts_init() | configuration of defaults in bts/trx/s object
| bts-specific | bts_model_init | ?
| common | abis_init() | Initialization of libosmo-abis
| common | vty_read_config_file() | Reading of configuration file
| bts-specific | bts_model_phy_link_set_defaults() | Called for every PHY link created
| bts-specific | bts_model_phy_instance_set_defaults() | Called for every PHY Instance created
| common | bts_controlif_setup() | Initialization of Control Interface
| bts-specific | bts_model_ctrl_cmds_install() | Install model-specific control interface commands
| common | telnet_init() | Initialization of telnet interface
| common | pcu_sock_init() | Initialization of PCU socket
| common | main() | Installation of signal handlers
| common | abis_open() | Start of the A-bis connection to BSC
| common | phy_links_open() | Iterate over list of configured PHY links
| bts-specific | bts_model_phy_link_open() | Open each of the configured PHY links
| common | write_pid_file() | Generate the pid file
| common | osmo_daemonize() | Fork as daemon in background (if configured)
| common | bts_main() | Run main loop until global variable quit >= 2
|===
==== At time of OML establishment
.Control flow at time of OML establishment
[options="header",cols="10%,35%,55%"]
|===
| section | function | description
| bts-specific | bts_model_oml_estab() | Called by core once OML link is established
| bts-specific | bts_model_check_oml() | called each time OML sets some attributes on a MO, checks if attributes are valid
| bts-specific | bts_model_apply_oml() | called each time OML sets some attributes on a MO, stores attribute contents in data structures
| bts-specific | bts_model_opstart() | for NM_OC_BTS, NM_OC_SITE_MANAGER, NM_OC_GPRS_NSE, NM_OC_GPRS_CELL, NMO_OC_GPRS_NSVC
| bts-specific | bts_model_opstart() | for NM_OC_RADIO_CARRIER for each trx
| bts-specific | bts_model_opstart() | for NM_OC_BASEB_TRANSC for each trx
| bts-specific | bts_model_opstart() | for NM_OC_CHANNEL for each timeslot on each trx
| bts-specific | bts_model_change_power() | change transmit power for each trx (power ramp-up/ramp-down)
|===
==== At time of RSL connection loss
.Control flow at time of RSL connection loss
[options="header",cols="10%,35%,55%"]
|===
| section | function | description
| bts-specific | bts_model_abis_close() | called when either one of the RSL links or the OML link are down
|===

View File

@@ -0,0 +1,484 @@
[[osmobts_hardware_support]]
== OsmoBTS hardware support
OsmoBTS consists of a _common_ part that applies to all BTS models as well as
_hardware-specific_ parts for each BTS model. The hardware specific parts are
generally referred to as the _bts_model_ code.
The common part includes the core BTS architecture as well as code for
implementing the external interfaces such as Abis, control, PCU socket and
GSMTAP.
The bts_model parts include support for driving one particular
implementation of a GSM physical layer (PHY). Such a physical layer
implementation can come in many forms. Sometimes it runs on a general
purpose CPU, sometimes on a dedicated ARM core, a dedicated DSP, a
combination of DSP and FPGA.
Every PHY implementation offers some kind of primitives by which the PHY
can be controlled, and by which the PHY exchanges data with the higher
layers of the protocol stack in the OsmoBTS code.
The PHY-specific primitives are encapsulated in the bts_model code, and
offered as a PHY-independent _L1SAP_ interface towards the common part of
OsmoBTS.
In addition, each bts_model implements a set of functions that the
common part calls. Those functions are pre-fixed by _bts_model__.
Each bts_model may offer
* model-specific VTY commands for both configuration and run-time interaction
* model-specific command line arguments
* model-specific control interface commands
== `osmo-bts-sysmo` for sysmocom sysmoBTS
The sysmocom sysmoBTS is a range of GSM BTSs based around an embedded
system implementing the PHY in a combination of DSP+FPGA. The PHY is
configured by a set of primitives described by header files. Those
primitives are exchanged over a set of message queues exposed on the
Linux-running ARM core via device nodes in `/dev/msgq/`. Internally,
the message queues map to shared memory between the Linux-running ARM
core and the DSP running the PHY implementation.
The OsmoBTS bts_model code for the sysmoBTS can be found in the
`src/osmo-bts-sysmo` sub-directory of the OsmoBTS code base.
`osmo-bts-sysmo` has been the primary target platform for
OsmoBTS for many years and is thus the most feature-complete and mature
platform supported by OsmoBTS at this point.
The sysmoBTS PHY supports a direct PHY interface to OsmoPCU, reducing
the latency and amount of primitives that OsmoBTS would otherwise need
to pass through from the PHY message queues to the PCU socket and
vice-versa.
=== `osmo-bts-sysmo` specific command line arguments
*--dsp-trace 'DSPMASK'*::
Set the DSP trace flags (a single hexadecimal 32bit value).
This has been deprecated by VTY based commands, see
<<osmo-bts-sysmo-dsp-trace>> for further information.
*--pcu-direct*::
Indicate that an external PCU (e.g. OsmoPCU) will directly
open the DSP message queues to the PHY / PH-SAP, and only MPH
primitives are passed via OsmoBTS.
=== `osmo-bts-sysmo` specific VTY commands
For a auto-generated complete syntax reference of the VTY commands,
please see the associated _OsmoBTS VTY reference manual_
<<vty-ref-osmobts>>. The section
below only lists the most important commands.
==== at the 'SHOW' node
===== `show trx 0 clock-source`
Display the currently active clock source configuration for the TRX
[[osmo-bts-sysmo-dsp-trace]]
===== `show trx 0 dsp-trace-flags`
Show the currently active DSP trace flags for the TRX
===== `trx 0 dsp-trace-flag`
Use this command to enable/disable/configure the DSP tracing flags that
define what debug messages will appear on `/dev/rtfifo/dsp_trace`.
==== at the 'ENABLE' node
===== `trx 0 tx-power <-110-100>`
Change the current TRX transmit power to the given value in dBm.
===== `trx 0 rf-clock-info reset`
Part of the clock calibration procedure:
Reset the clock correction value.
===== `trx 0 rf-clock-info correct`
Part of the clock calibration procedure:
Apply the current measured correction value between the reference clock
and the local clock.
==== at the 'PHY instance' node
==== `clock-calibration eeprom`
Obtain clock calibration value from EEPROM.
==== `clock-calibration default`
Use hardware default clock calibration value.
==== `clock-calibration <-4095-4095>`
Use specified clock calibration value (not EEPROM/default).
==== `clock-source (tcxo|ocxo|ext|gps)`
Specify the clock source for the PHY:
tcxo::
Use the TCXO. This is the default on sysmoBTS 2050.
ocxo::
Use the OCXO (only valid on units equipped with OCXO). This is
the default on all sysmoBTS 1002/1020/1100 and SOB-BTS.
ext::
Use the external clock input.
gps::
Use the clock derived from GPS. You shouldn't use this clock
directly, but rather use the TCXO and regularly re-calibrate
against GPS.
==== `trx-calibration-path PATH`
Use calibration files from the given 'PATH', rather tan calibration
values from the EEPROM.
=== `osmo-bts-sysmo` specific control interface commands
==== trx.0.clock-info
Obtain information on the current clock status:
----
bsc_control.py -d localhost -p 4238 -g trx.0.clock-info
Got message: GET_REPLY 1 trx.0.clock-info -100,ocxo,0,0,gps
----
which is to be interpreted as:
* current clock correction value is -100 ppb
* current clock source is OCXO
* deviation between clock source and calibration source is 0 ppb
* resolution of clock error measurement is 0 ppt (0 means no result yet)
* current calibration source is GPS
When this attribute is set, any value passed on is discarded, but the clock
calibration process is re-started.
==== trx.0.clock-correction
This attribute can get and set the current clock correction value:
----
bsc_control.py -d localhost -p 4238 -g trx.0.clock-correction
Got message: GET_REPLY 1 trx.0.clock-correction -100
----
----
bsc_control.py -d localhost -p 4238 -s trx.0.clock-correction -- -99
Got message: SET_REPLY 1 trx.0.clock-correction success
----
== `osmo-bts-trx` for OsmoTRX
OsmoTRX is a C-language implementation of the GSM radio modem,
originally developed as the 'Transceiver' part of OpenBTS. This radio
modem offers an interface based on top of UDP streams.
The OsmoBTS bts_model code for OsmoTRX is called
`osmo-bts-trx`. It implements the UDP stream interface of
OsmoTRX, so both parts can be used together to implement a complete GSM
BTS based on general-purpose computing SDR.
As OsmoTRX is general-purpose software running on top of Linux, it is thus not
tied to any specific physical hardware. At the time of this writing, OsmoTRX
supports a variety of Lime Microsystems and Ettus USRP SDRs via the UHD driver,
as well as the Fairwaves UmTRX and derived products.
OsmoTRX is not a complete GSM PHY but 'just' the radio modem. This
means that all of the Layer 1 functionality such as scheduling,
convolutional coding, etc. is actually also implemented inside OsmoBTS.
As such, the boundary between OsmoTRX and `osmo-bts-trx` is at
a much lower interface, which is an internal interface of other more
traditional GSM PHY implementations.
Besides OsmoTRX, there are also other implementations (both Free
Software and proprietary) that implement the same UDP stream based radio
modem interface.
=== `osmo-bts-trx` specific VTY commands
For a auto-generated complete syntax reference of the VTY commands,
pleas see the associated _OsmoBTS VTY reference manual_
<<vty-ref-osmobts>>. The section below only lists the most important
commands.
==== at the 'SHOW' node
===== `show transceivers`
Display information about configured/connected OsmoTRX transceivers in
human-readable format to current VTY session.
==== at the 'PHY' configuration node
===== `osmotrx ip HOST`
Set the IP address for the OsmoTRX interface for both the local (OsmoBTS) and
remote (OsmoTRX) side of the UDP flows. This option has been deprecated by the
more detailed option `osmotrx ip (local|remote) A.B.C.D`.
===== `osmotrx ip (local|remote) A.B.C.D`
Set the IP address for the OsmoTRX interface for either the local (OsmoBTS) or
remote (OsmoTRX) side of the UDP flows.
===== `osmotrx base-port (local|remote) <0-65535>`
Configure the base UDP port for the OsmoTRX interface for either the
local (OsmoBTS) or remote (OsmoTRX) side of the UDP flows.
===== `osmotrx fn-advance <0-30>`
Set the number of frames to be transmitted to transceiver in advance of
current GSM frame number.
GSM is a TDMA (time division multiple access) system on the radio
interface. OsmoTRX is the "clock master" of that in the Osmocom
implementation. It informs OsmoBTS of the current GSM frame
number. However, as there is non-zero delays (UDP packet trnsmission
delay, operating system scheduler delay on both OsmoTRX and OsmoBTS
side, ...), OsmoBTS must compensate for that delay by "advancing"
the clock a certain amount of time.
In other words, if OsmoTRX informs us that the current frame number is N,
we advance it by `fn-advance` and transmit burst data for
`N + fn-advance` towards OsmoTRX.
The fn-advance should be kept as low as possible to avoid additional
delays to the user voice plane as well as to improve the performance
of the control plane (LAPDm) as well as GPRS.
However, fn-advance must be kept sufficiently high to ensure no
underruns on the OsmoTRX side.
The detailed value will depend on your underlying computer systems,
operating system and related tuning parameters. Running OsmoTRX
on a remote host will inevitably require a higher fn-advance then
running it on the same machine, where the UDP packetes are just passed
over the loopback device.
The default value for `fn-advance` is 20 (corresponding to 92
milliseconds).
===== `osmotrx rts-advance <0-30>`
Set the number of frames to be requested from L1SAP in advance of current
frame number and fn-advance.
The value specified as `rts-advance` is added to the current GSM frame
number as reported by OsmoTRX *and* the `osmotrx fn-advance` in order
to generate the PH-RTS.ind (ready to send indications) across the L1SAP
interface inside osmo-bts. This will trigger the Layer 2 (LAPDm for
the control plane, RTP for the voice plane, and OsmoPCU for GPRS) to
generate a MAC block and input it into the osmo-bts-trx TDMA scheduler.
If OsmoTRX reported N as the current frame number, the actual frame number
reported on L1SAP to higher layers will be computed as follows:
N + fn-advance + rts-advance
The default value of `rts-advance` is 5 (corresponding to 23 milliseconds).
Do not change this unless you have a good reason!
===== `osmotrx rx-gain <0-50>`
Set the receiver gain (configured in the hardware) in dB.
===== `osmotrx tx-attenuation <0-50>`
Set the transmitter attenuation (configured in the hardware) in dB.
===== `osmotrx tx-attenuation oml`
Use the Value in the A-bis OML Attribute `MAX_POWER_REDUCTION` as
transmitter attenuation.
==== at the 'PHY Instance' configuration node
===== `slotmask (1|0) (1|0) (1|0) (1|0) (1|0) (1|0) (1|0) (1|0)`
Configure which timeslots should be active on this TRX. Normally all
timeslots are enabled, unless you are running on a cpu-constrained
deeply embedded system.
===== `osmotrx maxdly <0-31>`
Set the maximum delay for received symbols (in number of GSM symbols).
== `osmo-bts-octphy` for Octasic OCTPHY-2G
The Octasic OCTPHY-2G is a GSM PHY implementation inside an Octasic
proprietary 24-core DSP called OCTDSP.
This DSP has a built-in Gigabit Ethernet interface, over which it
exchanges PHY-layer primitives in raw Ethernet frames with the upper
layers running on another CPU attached to the same Ethernet. Those
primitives are described in a set of C-language header files.
OsmoBTS implements the raw Ethernet frame based primitives as well as
the associated transport protocol (OKTPKT/OCTVC1) in the
`osmo-btso-octphy` bts_model code.
You can run the `osmo-bts-octphy` on any system connected to the same
Ethernet as the OCTDSP running the OCTPHY. This can be either an
embedded ARM or x86 SoM part of the OCTBTS hardware, or it can be any
other Linux system attached via an Ethernet switch.
Each OCTDSP running OCTSDR-2G offers a set of primitives part of a
OCTPKT session, which is mapped to an OsmoBTS PHY link. Depending on
the OCTSDR-2G software version, you may create multiple software TRX by
creating multiple OsmoBTS PHY instances inside that PHY link.
Multiple DSPs may exist in one circuit board, then each of the DSPs is
interfaced by one OsmoBTS PHY link, and each of them may have one or
more OsmoBTS PHY instances creating a Multi-TRX configuration.
== `osmo-bts-litecell15` for Nutaq/Nuran LiteCell 1.5
The Nutaq/Nuran LiteCell 1.5 implements a dual-transceiver GSM BTS based
on a mixed ARM/DSP/FPGA architecture. The PHY layer is implemented on
DSP/FPGA and similar to that of the sysmoBTS: It exchanges primitives
described in a set of C-language header files over message queues
between the ARM and the DSP.
This interface is implemented in the `osmo-bts-litecell15` bts_model of
OsmoBTS. You would run `osmo-bts-litecell15` on the ARM/Linux processor
of the Litecell 1.5.
The two transceivers of the Litecell 1.5 each have their own set of DSP
message queues. Each set of message queues is wrapped into one OsmoBTS
PHY link, offering one OsmoBTS PHY instance.
The Litecell 1.5 PHY supports a direct PHY interface to OsmoPCU,
reducing the latency and amount of primitives that OsmoBTS would
otherwise need to pass through from the PHY message queues to the PCU
socket and vice-versa.
=== `osmo-bts-trx` specific VTY commands
For a auto-generated complete syntax reference of the VTY commands,
please see the associated _OsmoBTS VTY reference manual_
<<vty-ref-osmobts>>. The section below only lists the most important
commands.
==== at the 'SHOW' node
===== `show phy <0-255> system-information`
Show information about the hardware platform, DSP and OCTPHY-2G software
version.
===== `show phy <0-255> rf-port-stats <0-1>`
Show information about the RF port interfaces.
===== `show phy <0-255> clk-sync-stats`
Show information about the clock synchronization manager.
==== at the 'PHY' configuration node
===== `octphy hw-addr HWADDR`
Specify the Ethernet hardware address (mac address) of the DSP running
the OCTPHY-2G software for this PHY link.
===== `octphy net-device NAME`
Specify the Ethernet network device (like `eth0`) through which the DSP
can be reached from OsmoBTS.
===== `octphy rf-port-index <0-255>`
Specify which RF port should be used for this PHY link.
===== `octphy rx-gain <0-73>`
Configure the receiver gain in dB.
===== `octphy tx-attenuation <0-359>`
Configure the transmitter attenuation in quarter-dB
== `osmo-bts-virtual` for Virtual Um Interface
This is a special BTS model used for research, simulation and testing.
Rather than communicating over a wireless RF interface, the GSM Um
messages are encapsulated over GSMTAP/UDP/IP.
The Virtual Um interface (i.e. virtual radio layer) between OsmoBTS and
OsmocomBB allows us to run a complete GSM network with 1-N BTSs and 1-M
MSs without any actual radio hardware, which is of course excellent for
all kinds of testing scenarios.
The Virtual Um layer is based on sending L2 frames (blocks) encapsulated
via GSMTAP UDP multicast packets. There are two separate multicast
groups, one for uplink and one for downlink. The multicast nature
simulates the shared medium and enables any simulated phone to receive
the signal from multiple BTSs via the downlink multicast group.
In OsmoBTS, this is implemented via the `osmo-bts-virtual` BTS model.
Setting up OsmoBTS in its `osmo-bts-virtual` flavor isn't really much
different from setting it up with real hardware. The amount of required
configuration at the BTS configuration file is (as always) very minimal,
as in the GSM network architecture provides almost all relevant
configuration to the BTS from the BSC.
An example configuration file is provided as part of the osmo-bts source
code: `doc/examples/virtual/osmobts-virtual.cfg`
For more information see
http://osmocom.org/projects/cellular-infrastructure/wiki/Virtual_Um
=== `osmo-bts-virtual` specific VTY commands
For a auto-generated complete syntax reference of the VTY commands,
please see the associated _OsmoBTS VTY reference manual_
<<vty-ref-osmobts>>. The section below only lists the most important
commands.
==== at the 'PHY' config node
===== `virtual-um net-device NETDEV`
Configure the network device used for sending/receiving the virtual Um
interface messages (e.g. `eth0`).
===== `virtual-um ms-udp-port <0-65535>`
Configure the UDP port used for sending virtual Um
downlink messages towards the MS (default: GSMTAP 4729).
===== `virtual-um ms-multicast-group GROUP`
Configure the IP multicast group used for sending virtual
Um downlink messages towards the MS (default: 239.193.23.1)
===== `virtual-um bts-udp-port <0-65535>`
Configure the UDP port used for receiving virtual Um
uplink messages from the MS (default: GSMTAP 4729).
===== `virtual-um bts-multicast-group GROUP`
Configure the IP multicast group used for receiving virtual
Um uplink messages from the MS (default: 239.193.23.2)

View File

@@ -0,0 +1,210 @@
== BTS Configuration
The role of the BTS is to handle the GSM radio interface. When the BTS
application is starting, the A-bis OML connection is established towards
the BSC. Almost all BTS configuration (such as ARFCN, channel
configuration, transmit power, etc.) will be sent from the BSC to the
BTS via OML messages. After OML start-up has completed, the BSC will
instruct the BTS to establish the RSL connections.
Given that most configuration is downloaded from the BSC into the BTS at
start-up time, only some very basic settings have to be made in the
OsmoBTS software.
=== Command Line Options
The OsmoBTS executables (`osmo-bts-sysmo`, `osmo-bts-trx`,
`osmo-bts-octphy`, `osmo-bts-litecell15`, ...) share the following
generic command line options:
==== SYNOPSIS
*osmo-bts-sysmo* [-h|-V] [-d 'DBGMASK'] [-D] [-c 'CONFIGFILE' ] [-s] [-T] [-e 'LOGLEVEL'] [-r 'PRIO'] [-i 'GSMTAP-IP'] [-t <1-255>]
==== OPTIONS
*-h, --help*::
Print a short help message about the supported options
*-V, --version*::
Print the compile-time version number of the OsmoBTS program
*-d, --debug 'DBGMASK','DBGLEVELS'*::
Set the log subsystems and levels for logging to stderr. This
has mostly been superseded by VTY-based logging configuration,
see <<logging>> for further information.
*-D, --daemonize*::
Fork the process as a daemon into background.
*-c, --config-file 'CONFIGFILE'*::
Specify the file and path name of the configuration file to be
used. If none is specified, use `osmo-bts.cfg` in the current
working directory.
*-s, --disable-color*::
Disable colors for logging to stderr. This has mostly been
deprecated by VTY based logging configuration, see <<logging>>
for further information.
*-T, --timestamp*::
Enable time-stamping of log messages to stderr. This has mostly
been deprecated by VTY based logging configuration, see
<<logging>> for further information.
*-e, --log-level 'LOGLEVEL'*::
Set the global log level for logging to stderr. This has mostly
been deprecated by VTY based logging configuration, see
<<logging>> for further information.
*-r, --realtime 'PRIO'*::
Enable use of the Linux kernel realtime priority scheduler with
the specified priority.
It is recommended you use this option on low-performance
embedded systems or systems that encounter high non-GSM/GPRS
load.
*-i, --gsmtap-ip 'GSMTAP-IP'*::
Specify the destination IP address for GSMTAP messages.
*-t, --trx-num <1-255>*::
Specify the number of TRX supported by this BTS.
There may be additional, hardware specific command line options by the
different bts_model implementations.
=== Configuration using the VTY
Most configuration as well as run-time monitoring and system
introspection is implemented using a command-line based interface
called _VTY_. A full reference syntax of all existing VTY command is
available as a separate document.
See <<vty>> for further information on the VTY.
==== Required BTS/TRX configuration
There are some settings that have to be configured locally in the
sysmoBTS, as they cannot be set remotely from the BSC. Those
settings are stored in the OsmoBTS configuration file, which commonly
is stored in `/etc/osmocom/osmo-bts.cfg`.
.Example Minimal configuration file
----
!
! OsmoBTS (0.0.1.100-0455) configuration saved from vty
!!
!
phy 0 <1>
instance 0 <2>
bts 0 <3>
band DCS1800
ipa unit-id 1801 0 <4>
oml remote-ip 192.168.100.11 <5>
trx 0 <6>
phy 0 instance 0 <7>
----
<1> You must configure at least one PHY link by means of the PHY node
<2> You must configure at least one PHY instance in the PHY link
<3> There is always exactly one BTS (`bts 0`) configured in OsmoBTS
<4> The `ipa unit-id` is what is used to identify this BTS to the BSC
<5> The OML Remote IP is the IP address of the BSC, to which the BTS shall connect to.
<6> There must be at least one trx (`trx 0`) in each BTS
<7> Every TRX must be mapped to a specific PHY instance this way
For a full reference of all available VTY configuration parameters,
please refer to the OsmoBTS VTY Reference document.
[[gsmtap]]
==== Configuring GSMTAP tracing
In addition to being able to obtain pcap protocol traces of the A-bis
communication and the text-based logging from the OsmoBTS
software, there is also the capability of tracing all communication on
the radio interface. To do so, OsmoBTS can encapsulate
MAC blocks (23byte messages at the L2-L1 interface) into _GSMTAP_ and send
them via UDP/IP. At that point, they can be captured with utilities like
*tcpdump* or *tshark* for further analysis by the *wireshark* protocol
analyzer.
In order to activate this feature, you first need to make sure to start
OsmoBTS using the `-i` or `--gsmtap-ip` command line option, specifying
the destination IP address for the GSMTAP messages. In most cases,
using 127.0.0.1 for passing the messages over the loopback (`lo`) device
will be sufficient.
OsmoBTS can selectively trace such messages by their L1 SAPI, for both
Rx and Tx. For a complete list of L1 SAPI values, please refer to the
_OsmoBTS VTY reference manual_ <<vty-ref-osmobts>>.
For example, to enable GSMTAP tracing for messages on all SDCCH
channels, you can use the gsmtap-sapi sdcch command at the CONFIG TRX
node of the OsmoBTS VTY.
.Example: Enabling GSMTAP for SDCCH
----
OsmoBTS> enable
OsmoBTS# configure terminal
OsmoBTS(config)# bts 0
OsmoBTS(bts)# trx 0
OsmoBTS(trx)# gsmtap-sapi sdcch
OsmoBTS(trx)# write <1>
----
<1> the `write` command will make the configuration persistent in the
configuration file. This is not required if you wish to enable GSMTAP
only in the current session of OsmoBTS.
De-activation can be performed similarly by using the `no gsmtap-sapi
sdcch` command at the `trx` node of the OsmoBTS VTY.
From the moment they are enabled via VTY, GSMTAP messages will be
generated and sent in UDP encapsulation to the IANA-registered UDP port
for GSMTAP (4729) at the IP address specified in the command line
argument.
==== Configuring power ramping
OsmoBTS can ramp up the power of its trx over time. This helps reduce
cell congestion in busy environments.
In this example, the trx starts with 5dBm output power which increases by 1dB
every two seconds until it reaches nominal power.
Power ramping can use the power-ramp commands at the CONFIG TRX node of the
OsmoBTS VTY.
.Example: Configure power ramping on trx 0
----
OsmoBTS> enable
OsmoBTS# configure terminal
OsmoBTS(config)# bts 0
OsmoBTS(bts)# trx 0
OsmoBTS(trx)# power-ramp max-initial 5 dBm
OsmoBTS(trx)# power-ramp step-size 1 dB
OsmoBTS(trx)# power-ramp step-interval 2
OsmoBTS(trx)# write <1>
----
<1> the `write` command will make the configuration persistent in the
configuration file.
De-activating power-ramping can be performed by setting the max-initial value
to the nominal power. The default max-initial value is 23 dBm.
==== Running multiple instances
It is possible to run multiple instances of `osmo-bts` on one and the same
machine, if the phy-interface is flexible enough to distinguish between
different phy hardware interfaces.
Since usually a BTS instance runs in conjunction with a dedicated PCU instance,
the socket path between PCU and BTS has to be distinguished between the running
instances. It is possible to change the default socket path via VTY config:
.Example: Personalize PCU socket path
----
bts 0
pcu-socket /tmp/pcu_bts_2
----
It is also necessary to separate the VTY anc CTRL interfaces of the different
instances. The VTY, as well as the CTRL interface can be bound to a free IP
address from the loopback range:
.Example: Binding VTY and CTRL interface to a specific IP address
----
line vty
bind 127.0.0.2
ctrl
bind 127.0.0.2
----

View File

@@ -0,0 +1,24 @@
[[control]]
== Control interface
The actual protocol is described in <<common-control-if>>, the variables
common to all programs using it are described in <<ctrl_common_vars>>. Here we
describe variables specific to OsmoBTS. The commands starting with prefix
"net.btsN." are specific to a certain BTS so N have to be replaced with BTS
number when issuing command. Similarly the
TRX-specific commands are additionally prefixed with TRX number e. g.
"net.bts1.trx2.thermal-attenuation".
.Variables available over control interface
[options="header",width="100%",cols="20%,5%,5%,50%,20%"]
|===
|Name|Access|Trap|Value|Comment
|net.btsN.trxM.thermal-attenuation|RW|No|integer|See <<ther>> for details.
|===
[[ther]]
=== thermal-attenuation
Allowed SET value for thermal attenuation is between 0 to 40 dB. Note: the value
is SET in dB units but GET will return value in mdB units used internally.

View File

@@ -0,0 +1,4 @@
[[counters]]
== Counters
include::./counters_generated.adoc[]

View File

@@ -0,0 +1,64 @@
// autogenerated by show asciidoc counters
These counters and their description based on OsmoBTS 0.8.1.346-33ed (OsmoBTS).
=== Rate Counters
// generating tables for rate_ctr_group
// rate_ctr_group table E1 Input subsystem
.e1inp - E1 Input subsystem
[options="header"]
|===
| Name | Reference | Description
| hdlc:abort | <<e1inp_hdlc:abort>> | HDLC abort
| hdlc:bad_fcs | <<e1inp_hdlc:bad_fcs>> | HLDC Bad FCS
| hdlc:overrun | <<e1inp_hdlc:overrun>> | HDLC Overrun
| alarm | <<e1inp_alarm>> | Alarm
| removed | <<e1inp_removed>> | Line removed
|===
// rate_ctr_group table cell broadcast channel
.cbch - cell broadcast channel
[options="header"]
|===
| Name | Reference | Description
| cbch:rcvd_queued | <<cbch_cbch:rcvd_queued>> | Received + queued CBCH messages (Abis)
| cbch:rcvd_dropped | <<cbch_cbch:rcvd_dropped>> | Received + dropped CBCH messages (Abis)
| cbch:sent_single | <<cbch_cbch:sent_single>> | Sent single CBCH messages (Um)
| cbch:sent_default | <<cbch_cbch:sent_default>> | Sent default CBCH messages (Um)
| cbch:sent_null | <<cbch_cbch:sent_null>> | Sent NULL CBCH messages (Um)
|===
// rate_ctr_group table cell broadcast channel
.cbch - cell broadcast channel
[options="header"]
|===
| Name | Reference | Description
| cbch:rcvd_queued | <<cbch_cbch:rcvd_queued>> | Received + queued CBCH messages (Abis)
| cbch:rcvd_dropped | <<cbch_cbch:rcvd_dropped>> | Received + dropped CBCH messages (Abis)
| cbch:sent_single | <<cbch_cbch:sent_single>> | Sent single CBCH messages (Um)
| cbch:sent_default | <<cbch_cbch:sent_default>> | Sent default CBCH messages (Um)
| cbch:sent_null | <<cbch_cbch:sent_null>> | Sent NULL CBCH messages (Um)
|===
// rate_ctr_group table base transceiver station
.bts - base transceiver station
[options="header"]
|===
| Name | Reference | Description
| paging:rcvd | <<bts_paging:rcvd>> | Received paging requests (Abis)
| paging:drop | <<bts_paging:drop>> | Dropped paging requests (Abis)
| paging:sent | <<bts_paging:sent>> | Sent paging requests (Um)
| rach:rcvd | <<bts_rach:rcvd>> | Received RACH requests (Um)
| rach:drop | <<bts_rach:drop>> | Dropped RACH requests (Um)
| rach:handover | <<bts_rach:handover>> | Received RACH requests (Handover)
| rach:cs | <<bts_rach:cs>> | Received RACH requests (CS/Abis)
| rach:ps | <<bts_rach:ps>> | Received RACH requests (PS/PCU)
| agch:rcvd | <<bts_agch:rcvd>> | Received AGCH requests (Abis)
| agch:sent | <<bts_agch:sent>> | Sent AGCH requests (Abis)
| agch:delete | <<bts_agch:delete>> | Sent AGCH DELETE IND (Abis)
|===
== Osmo Stat Items
// generating tables for osmo_stat_items
== Osmo Counters
// generating tables for osmo_counters
// there are no ungrouped osmo_counters

View File

@@ -0,0 +1,20 @@
== Support for Dynamic Timeslots (TCH/F, TCH/H, PDCH)
OsmoBTS supports dynamic switchover of timeslots between different physical
channel configurations, initiated by the BSC via (non-standard) Abis messages
-- see the _OsmoBTS Abis Protocol Specification_ <<osmobts-abis-spec>>.
The Abis message handling for dynamic timeslots is independent of the BTS
model. However, dynamic switchover will only work for BTS models that implement
the internal API to reconnect a timeslot (_bts_model_ts_disconnect()_ and
_bts_model_ts_connect()_, see also <<osmobts_hardware_support>>).
Currently, these OsmoBTS models support dynamic timeslots:
* _osmo-bts-sysmo_
* _osmo-bts-litecell15_
* _osmo-bts-trx_
Dynamic timeslots are driven by the BSC and need to be configured there. When
using OsmoBSC or OsmoNITB, see the BTS configuration chapter on dynamic
timeslots in <<userman-osmobsc>> or <<userman-osmonitb>>, respectively.

View File

@@ -0,0 +1,156 @@
== OsmoBTS Interfaces
OsmoBTS offers a set of interfaces to interact with external entities:
* A-bis/IP interface to talk to the BSC
* bts_model specific PHY interface
* VTY interface
* Osmocom control interface
* GSMTAP interface
* PCU interface
=== OsmoBTS Abis/IP Interface
OsmoBTS implements the GSM A-bis interface as described in the relevant
3GPP specifications:
* A-bis RSL according to 3GPP TS 08.58
* A-bis OML according to 3GPP TS 12.21
As the 3GPP specifies A-bis only over E1 interfaces and not over IP,
significant enhancements and modifications to the 3GPP specifications are
employed. Nevertheless, the implementation tries to stay as close as
possible to the 3GPP specifications.
Please see the _OsmoBTS Abis Protocol Specification_
<<osmobts-abis-spec>> for more information on this subject.
=== bts_model specific PHY interface
This interface is specific to the bts_model that OsmoBTS was compiled
for. It can take any form as required by the respective hardware.
Please see the PHY documentation of your respective BTS hardware for more
details.
=== OsmoBTS VTY Interface
See <<vty>> for further information.
=== OsmoBTS Control Interface
The general structure of the Omsocom control interface is described in
<<common-control-if>>.
The number of control interface commands/attributes is currently quite
limited and largely depends on the bts_model used.
==== trx.N.thermal-attenuation
The idea of this parameter is to attenuate the system output power as part of
thermal management. In some cases the PA might be passing a critical level,
so an external control process can use this attribute to reduce the system
output power.
Please note that all values in the context of transmit power calculation
are integers in milli-dB (1/10000 bel), so the below example is setting
the attenuation at 3 dB:
----
bsc_control.py -d localhost -p 4238 -s trx.0.thermal-attenuation 3000
Got message: SET_REPLY 1 trx.0.thermal-attenuation 3000
----
----
bsc_control.py -d localhost -p 4238 -g trx.0.thermal-attenuation
Got message: GET_REPLY 1 trx.0.thermal-attenuation 3000
----
=== OsmoBTS GSMTAP Interface
GSMTAP is a standard created by Osmocom to UDP-encapsulate GSM protocol
messages normally communicated over non-IP interfaces for the primary
purpose of protocol analysis in the wireshark dissector.
The initial purpose was to encapsulate GSM Um frames including some
meta-data like ARFCN and GSM frame number into something that can be
parsed and dispatched within the wireshark dissector.
This interface has since been extended to many other
GSM/GPRS/UMTS interfaces and protocols, and even to TETRA and GMR.
In OsmoBTS, it is possible to export both uplink and downlink Um
messages via GSMTAP. There is a set of VTY configuration options to
specify for which logical channels of the Um interface GSMTAP messages
shall be emitted, and to which destination IP address they shall be
sent.
Using GSMTAP it is possible to place a virtual tap at the air interface
between BTS and MS, without going through the trouble of setting up an
actual radio receiver at the same frequencies. Also, GSMTAP export is
performed before the Um air-interface encryption (A5) is performed, so
all frames are always in plain text.
Please refer to <<gsmtap>> for more information on how to configure and
use this interface.
=== OsmoBTS PCU Socket Interface
In order to assist the provisioning of GPRS services over the same radio
interface as circuit-switched GSM, OsmoBTS exposes a Unix domain socket
based interface towards OsmoPCU.
OsmoPCU is the Osmocom implementation of the GPRS Packet Control Unit
(PCU), which is co-located with the BTS in the Osmocom implementation.
Contrary to that, many classic E1-based implementations of the GSM RAN
co-locate the PCU with the BSC. However, the GSM specifications keep
the location up to the implementor.
The GPRS network architecture is shown in <<fig-gprs-pcubts>>.
[[fig-gprs-pcubts]]
.GPRS network architecture
[graphviz]
----
digraph G {
rankdir=LR;
MS0 [label="MS"];
MS1 [label="MS"];
BTS;
BSC;
MSC;
PCU;
SGSN;
GGSN;
MS0->BTS [label="Um"];
MS1->BTS [label="Um"];
BTS->BSC [label="Abis"];
BSC->MSC [label="A"];
BTS->PCU [label="pcu_sock"];
PCU->SGSN [label="Gb"];
SGSN->GGSN [label="GTP"];
}
----
The PCU socket interface serves the following purposes:
* to pass PCU relevant configuration from BTS to PCU
* to forward paging requests from BTS to PCU
* to forward RACH Requests from BTS to PCU
Depending on your bts_model, the PCU may also be passing actual
PH-DATA.request / PH-DATA.indication / PH-RTS.indication primitives for
the PDCH. This is considered sub-optimal, and some BTS models offer a
direct interface by which the PCU can exchange those primitives directly
with the PHY.
The default PCU socket interface name is `/tmp/pcu_sock`, but this can
be overridden by the `pcu-socket` VTY command in the BTS configuration
VTY node.

View File

@@ -0,0 +1,105 @@
== Overview
=== About this manual
This manual should help you getting started with the OsmoBTS software.
It will cover aspects of configuring and running OsmoBTS as well as some
introduction about its internal architecture and external interfaces.
=== About OsmoBTS
OsmoBTS is an implementation of a GSM BTS (Base Transceiver Station). A
BTS serves as the interface between the Um radio interface towards
phones and the wired Abis interface towards the BSC (Base Station
Controller). It also implements the network side of the Layer 2 of the
Um radio interface: The LAPDm protocol.
OsmoBTS is licensed as Free and Open Source Software (FOSS) under _GNU
AGPLv3_ <<gnu-agplv3>>. It is developed as one GSM network
infrastructure component part of the overall Osmocom project.
As perhaps the first implementation of a GSM BTS ever in the industry,
OsmoBTS is implemented in a vendor-independent way and supports a large
variety of transceiver hardware and physical layer implementations from
many vendors.
=== Credits
OsmoBTS was originally developed in 2011 by Andreas Eversberg and Harald
Welte. It has since been maintained by Harald Welte and Holger Freyther
at sysmocom.
=== OsmoBTS in the Osmocom GSM network architecture
OsmoBTS can be used in combination with the various other GSM network
elements developed under the umbrella of the Osmocom project.
Typical configurations either use OsmoBTS with OsmoBSC, or with
OsmoNITB, as can be seen in the following figures.
[[fig-gsm-classic]]
.Classic GSM architecture using OsmoBTS with OsmoBTS components
[graphviz]
----
digraph G {
rankdir=LR;
MS0 [label="MS"]
MS1 [label="MS"]
MS2 [label="MS"]
MS3 [label="MS"]
BTS0 [label="OsmoBTS"]
BTS1 [label="OsmoBTS"]
BSC [label="OsmoBSC"]
MSC [label="MSC/VLR"]
HLR [label="HLR/AUC"]
MS0->BTS0 [label="Um"]
MS1->BTS0 [label="Um"]
MS2->BTS1 [label="Um"]
MS3->BTS1 [label="Um"]
BTS0->BSC [label="Abis"]
BTS1->BSC [label="Abis"]
BSC->MSC [label="A"]
MSC->HLR [label="C"]
MSC->EIR [label="F"]
MSC->SMSC
}
----
[[fig-gsm-nitb]]
.GSM architecture using OsmoBTS + OsmoNITB
[graphviz]
----
digraph G {
rankdir=LR;
MS0 [label="MS"]
MS1 [label="MS"]
MS2 [label="MS"]
MS3 [label="MS"]
BTS0 [label="OsmoBTS"]
BTS1 [label="OsmoBTS"]
MS0->BTS0 [label="Um"]
MS1->BTS0 [label="Um"]
MS2->BTS1 [label="Um"]
MS3->BTS1 [label="Um"]
BTS0->BSC [label="Abis"]
BTS1->BSC [label="Abis"]
subgraph cluster_nitb {
label = "OsmoNITB";
BSC
MSC [label="MSC/VLR"]
HLR [label="HLR/AUC"]
BSC->MSC [label="A"]
MSC->HLR [label="C"]
MSC->EIR [label="F"]
MSC->SMSC;
}
}
----
If intended by the user, it is of course also possible to implement an
OsmoBTS-compatible Abis-over-IP interface in any third party BSC. The
Abis/IP interface and its protocol are documented in the _OsmoBTS
Abis Protocol Specification_ <<osmobts-abis-spec>>. However, be advised
that such a configuration is currently not officially supported by
Osmocom.

85
doc/manuals/dtx.dot Normal file
View File

@@ -0,0 +1,85 @@
digraph dtx_dl_amr_fsm {
node [shape = doublecircle] ST_VOICE ST_FACCH ST_U_NOINH
node [shape = circle]
// default state for non-DTX and DTX when SPEECH is in progress
ST_VOICE -> ST_SID_F1 [ label = "E_SID_F" ]
ST_VOICE -> ST_F1_INH_V [ label = "E_INHIB" ]
ST_VOICE -> ST_U_NOINH [ label = "E_SID_U" ]
ST_VOICE -> ST_VOICE [ label = "E_VOICE" ]
ST_VOICE -> ST_VOICE [ label = "E_FACCH" ]
// SID-FIRST or SID-FIRST-P1 in case of AMR HR: start of silence period (might be interrupted in case of AMR HR)
ST_SID_F1 -> ST_SID_F1 [ label = "E_SID_F" ]
ST_SID_F1 -> ST_U_NOINH [ label = "E_SID_U" ]
ST_SID_F1 -> ST_F1_INH_F [ label = "E_FACCH" ]
ST_SID_F1 -> ST_SID_F2 [ label = "E_FIRST" ]
ST_SID_F1 -> ST_ONSET_V [ label = "E_ONSET" ]
// SID-FIRST P2 (only for AMR HR): actual start of silence period in case of AMR HR
ST_SID_F2 -> ST_U_NOINH [ label = "E_COMPL" ]
ST_SID_F2 -> ST_ONSET_F [ label = "E_FACCH" ]
ST_SID_F2 -> ST_ONSET_V [ label = "E_ONSET" ]
// SID-FIRST Inhibited: incoming SPEECH (only for AMR HR)
ST_F1_INH_V -> ST_F1_INH_V_REC [ label = "E_COMPL" ]
// SID-FIRST Inhibited: incoming FACCH frame (only for AMR HR)
ST_F1_INH_F -> ST_F1_INH_F_REC [ label = "E_COMPL" ]
// SID-UPDATE Inhibited: incoming SPEECH (only for AMR HR)
ST_U_INH_V -> ST_U_INH_V_REC [ label = "E_COMPL" ]
// SID-UPDATE Inhibited: incoming FACCH frame (only for AMR HR)
ST_U_INH_F -> ST_U_INH_F_REC [ label = "E_COMPL" ]
// Silence period with periodic comfort noise data updates (no Inhibition)
ST_U_NOINH -> ST_ONSET_F [ label = "E_FACCH" ]
ST_U_NOINH -> ST_VOICE [ label = "E_VOICE" ]
ST_U_NOINH -> ST_U_NOINH [ label = "E_SID_U" ]
ST_U_NOINH -> ST_U_NOINH [ label = "E_SID_F" ]
ST_U_NOINH -> ST_ONSET_V [ label = "E_ONSET" ]
ST_U_NOINH -> ST_SID_U [ label = "E_COMPL" ]
// SID-FIRST Inhibition recursion in progress: Inhibit itself was already sent, now have to send the voice that caused it
ST_F1_INH_V_REC -> ST_VOICE [ label = "E_COMPL" ]
ST_F1_INH_V_REC -> ST_VOICE [ label = "E_VOICE" ]
// SID-FIRST Inhibition recursion in progress: Inhibit itself was already sent, now have to send the voice that caused it
ST_F1_INH_F_REC -> ST_FACCH [ label = "E_COMPL" ]
ST_F1_INH_F_REC -> ST_FACCH [ label = "E_VOICE" ]
// SID-UPDATE Inhibition recursion in progress: Inhibit itself was already sent, now have to send the voice that caused it
ST_U_INH_V_REC -> ST_VOICE [ label = "E_COMPL" ]
ST_U_INH_V_REC -> ST_VOICE [ label = "E_VOICE" ]
// SID-UPDATE Inhibition recursion in progress: Inhibit itself was already sent, now have to send the voice that caused it
ST_U_INH_F_REC -> ST_FACCH [ label = "E_COMPL" ]
ST_U_INH_F_REC -> ST_FACCH [ label = "E_VOICE" ]
// Silence period with periodic comfort noise data updates (can be inhibited)
ST_SID_U -> ST_U_INH_F [ label = "E_FACCH" ]
ST_SID_U -> ST_VOICE [ label = "E_VOICE" ]
ST_SID_U -> ST_U_INH_V [ label = "E_INHIB" ]
ST_SID_U -> ST_U_NOINH [ label = "E_SID_U" ]
ST_SID_U -> ST_U_NOINH [ label = "E_SID_F" ]
// ONSET - end of silent period due to incoming SPEECH frame
ST_ONSET_V -> ST_ONSET_V_REC [ label = "E_COMPL" ]
// ONSET - end of silent period due to incoming FACCH frame
ST_ONSET_F -> ST_ONSET_F_REC [ label = "E_COMPL" ]
// ONSET recursion in progress: ONSET itself was already sent, now have to send the data that caused it
ST_ONSET_F_REC -> ST_FACCH [ label = "E_COMPL" ]
// ONSET recursion in progress: ONSET itself was already sent, now have to send the voice that caused it
ST_ONSET_V_REC -> ST_VOICE [ label = "E_COMPL" ]
// FACCH sending state
ST_FACCH -> ST_VOICE [ label = "E_VOICE" ]
ST_FACCH -> ST_FACCH [ label = "E_FACCH" ]
ST_FACCH -> ST_FACCH [ label = "E_SID_U" ]
ST_FACCH -> ST_FACCH [ label = "E_SID_F" ]
ST_FACCH -> ST_SID_F1 [ label = "E_COMPL" ]
}

View File

@@ -0,0 +1,83 @@
<revhistory>
<revision>
<revnumber>1</revnumber>
<date>December 2015</date>
<authorinitials>NJH, HW</authorinitials>
<revremark>
Initial version, reflecting OsmoBTS master branch as on 2015-Dec-7
(commit e28a20a2d9d049cd6312e218a7646593bbc43431).
</revremark>
</revision>
<revision>
<revnumber>2</revnumber>
<date>February 2016</date>
<authorinitials>HW</authorinitials>
<revremark>
Updated version with Message Sequence Chart of OML and RSL bring-up.
</revremark>
</revision>
<revision>
<revnumber>2.1</revnumber>
<date>February 2016</date>
<authorinitials>HW</authorinitials>
<revremark>
Fix A-bis OML/RSL port number swap in message seqeuence charts.
</revremark>
</revision>
<revision>
<revnumber>2.2</revnumber>
<date>July 2016</date>
<authorinitials>NJH, HW</authorinitials>
<revremark>
Add description on Dynamic Channel Configuration in OML and activation in RSL.
</revremark>
</revision>
</revhistory>
<authorgroup>
<author>
<firstname>Neels</firstname>
<surname>Hofmeyr</surname>
<email>nhofmeyr@sysmocom.de</email>
<authorinitials>NJH</authorinitials>
<affiliation>
<shortaffil>sysmocom</shortaffil>
<orgname>sysmocom - s.f.m.c. GmbH</orgname>
<jobtitle>Senior Software Developer</jobtitle>
</affiliation>
</author>
<author>
<firstname>Harald</firstname>
<surname>Welte</surname>
<email>hwelte@sysmocom.de</email>
<authorinitials>HW</authorinitials>
<affiliation>
<shortaffil>sysmocom</shortaffil>
<orgname>sysmocom - s.f.m.c. GmbH</orgname>
<jobtitle>Managing Director</jobtitle>
</affiliation>
</author>
</authorgroup>
<copyright>
<year>2015-2016</year>
<holder>sysmocom - s.f.m.c. GmbH</holder>
</copyright>
<legalnotice>
<para>
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.3 or any later version published by the Free Software
Foundation; with no Invariant Sections, no Front-Cover Texts,
and no Back-Cover Texts. A copy of the license is included in
the section entitled "GNU Free Documentation License".
</para>
<para>
The Asciidoc source code of this manual can be found at
<ulink url="http://git.osmocom.org/osmo-gsm-manuals/">
http://git.osmocom.org/osmo-gsm-manuals/
</ulink>
</para>
</legalnotice>

View File

@@ -0,0 +1,92 @@
:gfdl-enabled:
OsmoBTS Abis Protocol Specification
===================================
Neels Hofmeyr <nhofmeyr@sysmocom.de>
== Introduction
This document describes the A-bis interface of *OsmoBTS*. Based on 3GPP TS
12.21 and 08.58, this document indicates which of the 3GPP specified A-bis
messages and IEs are implemented according to 3GPP specifications, which of
these are not or not fully implemented, as well as OsmoBTS-specific extensions
to the A-bis interface not specified by 3GPP.
Extensions to the A-bis interface specific to OsmoBTS are detailed in this
document. For details on the messages and IEs that comply with above mentioned
3GPP specifications, please refer to those documents.
.3GPP document versions referred to by this document
[cols="20%,80%"]
|===
|3GPP TS 08.56 | version 8.0.1 Release 1999
|3GPP TS 08.58 | version 8.6.0 Release 1999
|3GPP TS 08.60 | version 8.2.1 Release 1999
|3GPP TS 12.21 | version 8.0.0 Release 1999
|===
.IETF documents referred to by his document
[cols="20%,80%"]
|===
|IETF RFC 768 | User Datagram Protocol
|IETF RFC 791 | Internet Protocol
|IETF RFC 793 | Transmission Control Protocol
|IETF RFC 1889 | RTP: A Transport Protocol for Real-Time Applications
|IETF RFC 3551 | RTP Profle for Audio and Video Conferences with Minimal Control
|IETF RFC 4867 | RTP Payload Format and Files Storage Format for the Adaptive Multi-Rate (AMR) and Adaptive Multi-Rate Wideband (AMR-WB) Audio Codecs
|IETF RFC 5993 | RTP Payload Format for Global Systems for Mobile Communications Half Rate (GSM-HR)
|===
== Overview
The OsmoBTS A-bis interface consists of traffic management messages (RSL, Radio
Signalling Link) and network management messages (OML, Operation & Maintenance
Link), encapsulated in an IPA multiplex.
OML and RSL each use a separate TCP connection.
.TCP port numbers used by OsmoBTS Abis/IP
[options="header",width="50%",cols="35%,65%"]
|===
|TCP Port Number|Usage
|3002|A-bis OML (inside IPA multiplex)
|3003|A-bis RSL (inside IPA multiplex)
|===
Both TCP connections for OML and RSL are established in the BTS -> BSC
direction, i.e. the BTS is running as a TCP client, while the BSC is
running as a TCP server.
The BTS first establishes the TCP connection for OML. Via OML, the BSC
instructs the BTS to which IP address the RSL connection shall be
established.
.Overview of A-bis connection establishment
["mscgen"]
----
include::{srcdir}/abis/abis-startup.msc[]
----
=== Identities
The BTS is locally configured (via administrative means, out of band of
this specification) to have a Unit ID. The Unit ID consists of three
parts:
* The Site Number
* The BTS number at the site
* The TRX number within the BTS
include::{srcdir}/abis/ipa.adoc[]
include::{srcdir}/abis/oml.adoc[]
include::{srcdir}/abis/rsl.adoc[]
include::{srcdir}/abis/rtp.adoc[]
include::./common/chapters/port_numbers.adoc[]
include::./common/chapters/glossary.adoc[]
include::./common/chapters/gfdl.adoc[]

View File

@@ -0,0 +1,42 @@
<revhistory>
<revision>
<revnumber>1</revnumber>
<date>January 2016</date>
<authorinitials>HW</authorinitials>
<revremark>
Initial version, reflecting OsmoBTS master branch as on FIXME
(commit FIXME).
</revremark>
</revision>
</revhistory>
<authorgroup>
<author>
<firstname>Harald</firstname>
<surname>Welte</surname>
<email>hwelte@sysmocom.de</email>
<authorinitials>HW</authorinitials>
<affiliation>
<shortaffil>sysmocom</shortaffil>
<orgname>sysmocom - s.f.m.c. GmbH</orgname>
<jobtitle>Managing Director</jobtitle>
</affiliation>
</author>
</authorgroup>
<copyright>
<year>2016</year>
<holder>sysmocom - s.f.m.c. GmbH</holder>
</copyright>
<legalnotice>
<para>
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.3 or any later version published by the Free Software
Foundation; with the Invariant Sections being just 'Foreword',
'Acknowledgements' and 'Preface', with no Front-Cover Texts,
and no Back-Cover Texts. A copy of the license is included in
the section entitled "GNU Free Documentation License".
</para>
</legalnotice>

View File

@@ -0,0 +1,43 @@
:gfdl-enabled:
OsmoBTS User Manual
===================
Harald Welte <hwelte@sysmocom.de>
include::./common/chapters/preface.adoc[]
include::{srcdir}/chapters/overview.adoc[]
include::./common/chapters/abis.adoc[]
include::{srcdir}/chapters/interfaces.adoc[]
include::{srcdir}/chapters/control.adoc[]
include::./common/chapters/counters-overview.adoc[]
include::{srcdir}/chapters/counters.adoc[]
include::./common/chapters/vty.adoc[]
include::./common/chapters/logging.adoc[]
include::{srcdir}/chapters/configuration.adoc[]
include::{srcdir}/chapters/dynamic-timeslots.adoc[]
include::{srcdir}/chapters/bts-models.adoc[]
include::{srcdir}/chapters/architecture.adoc[]
include::./common/chapters/trx_if.adoc[]
include::./common/chapters/control_if.adoc[]
include::./common/chapters/port_numbers.adoc[]
include::./common/chapters/bibliography.adoc[]
include::./common/chapters/glossary.adoc[]
include::./common/chapters/gfdl.adoc[]

View File

@@ -0,0 +1,38 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
ex:ts=2:sw=42sts=2:et
-*- tab-width: 4; c-basic-offset: 4; indent-tabs-mode: nil -*-
-->
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML 5.0//EN"
"http://docbook.org/xml/5.0/dtd/docbook.dtd" [
<!ENTITY chapter-vty SYSTEM "./common/chapters/vty.xml" >
<!ENTITY sections-vty SYSTEM "generated/docbook_vty.xml" >
]>
<book>
<info>
<revhistory>
<revision>
<revnumber>v1</revnumber>
<date>13th October 2016</date>
<authorinitials>hw</authorinitials>
<revremark>Initial</revremark>
</revision>
</revhistory>
<title>OsmoBTS VTY Reference</title>
<copyright>
<year>2016</year>
</copyright>
<legalnotice>
<para>This work is copyright by <orgname>sysmocom - s.f.m.c. GmbH</orgname>. All rights reserved.
</para>
</legalnotice>
</info>
<!-- Main chapters-->
&chapter-vty;
</book>

17
doc/manuals/regen_doc.sh Executable file
View File

@@ -0,0 +1,17 @@
#!/bin/sh -x
if [ -z "$DOCKER_PLAYGROUND" ]; then
echo "You need to set DOCKER_PLAYGROUND"
exit 1
fi
SCRIPT=$(realpath "$0")
MANUAL_DIR=$(dirname "$SCRIPT")
COMMIT=${COMMIT:-$(git log -1 --format=format:%H)}
cd "$DOCKER_PLAYGROUND/scripts" || exit 1
OSMO_BTS_BRANCH=$COMMIT ./regen_doc.sh osmo-bts 4241 \
"$MANUAL_DIR/chapters/counters_generated.adoc" \
"$MANUAL_DIR/vty/bts_vty_reference.xml"

View File

@@ -0,0 +1,73 @@
<revhistory>
<revision>
<revnumber>1</revnumber>
<date>October 2016</date>
<authorinitials>HW</authorinitials>
<revremark>
Initial version
</revremark>
</revision>
<revision>
<revnumber>2</revnumber>
<date>November 2016</date>
<authorinitials>MS</authorinitials>
<revremark>
FSM added
</revremark>
</revision>
<revision>
<revnumber>3</revnumber>
<date>July 2017</date>
<authorinitials>PE</authorinitials>
<revremark>
Add section and update sequence charts to describe requirement to receive all PH-DATA.ind events
</revremark>
</revision>
</revhistory>
<authorgroup>
<author>
<firstname>Harald</firstname>
<surname>Welte</surname>
<email>hwelte@sysmocom.de</email>
<authorinitials>HW</authorinitials>
<affiliation>
<shortaffil>sysmocom</shortaffil>
<orgname>sysmocom - s.f.m.c. GmbH</orgname>
<jobtitle>Managing Director</jobtitle>
</affiliation>
</author>
<author>
<firstname>Max</firstname>
<surname>Suraev</surname>
<email>msuraev@sysmocom.de</email>
<authorinitials>MS</authorinitials>
<affiliation>
<shortaffil>sysmocom</shortaffil>
<orgname>sysmocom - s.f.m.c. GmbH</orgname>
<jobtitle>Software Developer</jobtitle>
</affiliation>
</author>
</authorgroup>
<copyright>
<year>2016</year>
<holder>sysmocom - s.f.m.c. GmbH</holder>
</copyright>
<legalnotice>
<para>
Permission is granted to copy, distribute and/or modify this
document under the terms of the GNU Free Documentation License,
Version 1.3 or any later version published by the Free Software
Foundation; with no Invariant Sections, no Front-Cover Texts,
and no Back-Cover Texts. A copy of the license is included in
the section entitled "GNU Free Documentation License".
</para>
<para>
The Asciidoc source code of this manual can be found at
<ulink url="http://git.osmocom.org/osmo-gsm-manuals/">
http://git.osmocom.org/osmo-gsm-manuals/
</ulink>
</para>
</legalnotice>

1362
doc/manuals/rtp-amr.adoc Normal file

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More