Compare commits

...

690 Commits

Author SHA1 Message Date
Keith
9192c6c6c2 Merging parts of commit 653e974fec00414ba85baf258ccc46ea778a53bd
from branch nrw/litecell15
Original Author: Minh-Quang Nguyen <minh-quang.nguyen@nutaq.com>
 LC15: Implementation of LC15 specific features

Made some modifications to this commit
based on d8cd756da4
 Get rid of 'struct gsm_bts_role_bts'

Only compile tested.
This is just to get a start on this branch.
I have not yet looked at all other commits in the
nuran branch that may be related.

This one however, does seem to be important
as it implements a larger cell radius than
is currently possible with osmo master.

Change-Id: I79416faaa3ba328c9c2dabcd695a1b880fe666da
2020-03-31 22:06:37 -05:00
Oliver Smith
ae4d85d891 VTY: add "test send-failure-event-report"
Send test failure event report OML message to the BSC. I found this
useful while manually testing related handling code in OsmoBSC.

Related: OS#1605
Change-Id: I0c4eba1636d8faf5012db26643bdf1d9fb6bfa1e
2020-03-24 08:01:05 +00:00
Philipp Maier
dbb5addf7d osmo-bts-trx: do not set rx-gain to 1 by default
The sample configs supplied within the doc/trx directory set the
rx-gain parameter to 1. A low value like this may cause a noticeable
degration of rx performance (For an USRP B200 an rx-gain of 38dbm is
recommended). Lets remove this seting from the sample configuration to
allow the default settings in osmo-trx to be applied.

Change-Id: I76be1739b638b3c1b0de5ac667eed53397631caa
Related: OS#4467
2020-03-23 17:18:51 +00:00
Harld Welte
e2f9d0eabe trx: Use NOPE indications on SDCCH
Without using the NOPE indication it might happen that we get
into the following situation:
* bursts 0,1,2 of a given block are received
* burst 3 is lost on the radio interface, OsmoTRX sends NOPE
* osmo-bts-trx doesn't pass the NOPE the the rx_tch*_fn()
* we never detect the end of the block, never perform decoding
  and even if the burst could be fully decoded, we loose the block

Related: OS#4661
Related: OS#2975
Change-Id: Idfc5c9a23db808c5f87ef5646c7e1d1cd3127371
2020-03-22 14:06:56 +01:00
Harld Welte
4e07b83a64 trx: Use NOPE indications from OsmoTRX for TCH/F and TCH/H
Without using the NOPE indication it might happen that we get
into the following situation:
* bursts 0,1,2 of a given block are received
* burst 3 is lost on the radio interface, OsmoTRX sends NOPE
* osmo-bts-trx doesn't pass the NOPE the the rx_tch*_fn()
* we never detect the end of the block, never perform decoding
  and even if the burst could be fully decoded, we loose the block

For voice, it can lead to lost RTP frames in uplink, which is also
problematic.

Let's deal with burst_len=0 in rx_tch*_fn() and use it as nope_fn.

Closes: OS#4661
Related: OS#2975
Change-Id: I0fbf4617daf24bd8aecfd9cfe1efd66cf73a277a
2020-03-22 14:06:47 +01:00
Harld Welte
f1efd727fb trx: Fix reported BER for TCH/H
This fixes a regression introduced in I710d0b7cf193afa8515807836ee69b8b7db84a84

We (obviously!) cannot compute the BER before performing convolutional
decoding.

Change-Id: I4e57f45d49cb513e4843e56f50c8de6980958fdc
Related: OS#2977
Related: OS#4667
2020-03-22 14:06:47 +01:00
Harald Welte
e36fbca15f osmo-bts-virtual: Fix "virtual-um net-device NETDEV"
The VTY option to bind the virtual Um multicast to a specific
network interface has existed ever since osmo-bts-virtual was
first merged to the repo.   However, embarrassingly, until today
it never did anything, i.e. the code to actually perform the bind
was missing.

Depends: libosmocore.git Ib52d22710020b56965aefcef09bde8247ace4a9c
Change-Id: I303f2e616d2d32b5a8005c3dcf0f5fad19ad3445
Related: OS#2966
2020-03-10 21:36:00 +01:00
Harald Welte
5914d76d5c osmo-bts-virtual: Add "virtual-um ttl <0-255>" VTY option
This can be used to determine the multicast TTL packet and hence
how far the packet will propagate in the network.  If you want to
operate the virtual Um only on your own machine, a TTL of 0 would
prevent the packets from ever being transmitted on your local
ethernet segment.

Change-Id: I18a9f93b764aee4e1dc68a1c6ac4d078e52ca61d
Related: OS#2966
2020-03-10 21:35:56 +01:00
Oliver Smith
cb4340b8a4 rsl: make IP DSCP configurable
Related: OS#4438
Depends: libosmo-abis I41603db8c1286660ad57ac1c78a8fb393a2b080b
Change-Id: Icdef5d40243fefdeae23f3bcf9c6702e8487928a
2020-03-08 17:56:52 +01:00
Harald Welte
58d79e88ad osmo-bts-virtual: implement GSMTAP_CHANNEL_VOICE
GSMTAP_CHANNEL_VOICE is the mechanism by which GSMTAP can [finally!]
be used to transport circuit-switched voice codec payload, and not
just signalling.

Original patch by Neels Hofmeyr, heavily extended by Harald Welte.

Depends: libosmocore.git I952044a17334f35712e087dc41781805000aebc1
Change-Id: I1cd9a251ce0b87181a0822d7940bbfc9f1428543
2020-03-08 17:56:52 +01:00
Harald Welte
6a5039674f l1sap: Use msgb_pull_l2() and unify l1sap_tch_ind + l1sap_ph_data_ind
In l1sap_ph_data_ind() we can use msgb_pull_l2() which is an exact
implementation of the functionality there.

In l1sap_tch_ind(), the existing code is actually wrong by making the
assumption that the msgb contains exactly an entire osmo_phsap_prim.
Better to also dynamically compute the number of bytes to ensure
we only pull those ahead of the L2 header, no matter what their exact
count.

Change-Id: I13f7f8ba93795e40b1fb4a306fe765e059f642cf
2020-03-08 17:12:15 +01:00
Vadim Yanitskiy
3f35ab258d osmo-bts-virtual: do not log GSMTAP message sending failure twice
Change-Id: I39e9edf35240ef31e3432412b459c2b8fb0de054
2020-03-04 20:43:02 +07:00
Vadim Yanitskiy
f9e7ccce27 osmo-bts-virtual: do not print redundant info in tx_to_virt_um()
LOGL1S() already prints enough context information.

Change-Id: I29adf9360b96544b7f58766d5cd26d97117884d9
2020-03-02 00:26:33 +07:00
Vadim Yanitskiy
2b948a3d17 osmo-bts-virtual: fix wrong endianness in gsmtap_hdr_stringify()
Change-Id: Ic9e84dc4adc44df735cba102bdace2fb1993ac8e
2020-02-29 18:09:46 +07:00
Vadim Yanitskiy
1f932689fc common/sysinfo: reduce criticality of a logging message
During the process of bootstrapping, it may happen that System
Information Type 3 is not yet received from the BSC, while the
BTS already needs to transmit a block on AGCH or PCH.

Since the RSL link is established later than the OML link, it's
kind of expected, so we should not log it as error.

Change-Id: I41aa3dbe375cf42c39032bafa80dba94d6219d35
2020-02-29 14:29:27 +07:00
Vadim Yanitskiy
7364ef15d9 vty: fix left shift by 31 cannot be represented in type 'int'
Change-Id: I3e5940e8f360bf6563f4c1b5ebd09579f9108c81
2020-02-27 23:35:09 +07:00
Harald Welte
24f98a0df9 virtual: Fix VTY commands to specify GSMTAP multicast groups
osmo-bts-virtual uses GSMTAP over multicast groups to communicate
with one or more virtphy instances.  There are some well-known default
multicast groups, but those can also be overridden via the VTY.

The problem is: If you actually try that, osmo-bts-virtual will abort,
as we try to talloc_free() when using osmo_talloc_replace_string()
on the constant default string.

The proper solution is to talloc_strdup() the constant default string
when setting the default value in bts_model_phy_link_set_defaults().

Change-Id: Ia96fea891a22e5a3c47ce658eda130ba8d4fc411
2020-02-26 14:36:58 +01:00
Pau Espin Pedrol
6ea3b28321 cosmetic: Fix some typos with codespell
Change-Id: I1bbb4871f764816dcbba86d833194be601fa9228
2020-02-25 18:51:15 +01:00
Pau Espin Pedrol
eba074e081 bts-trx: trx_if.c: Fix some printf formats
Compiler from raspberrypi4 warns/errors about those.

Change-Id: I4f973eb4ffdf8869b522d14e25853357fcd1e984
2020-02-25 18:28:52 +01:00
Philipp Maier
5184576572 osmo-bts-sysmo: merge measurement data and payload
For osmo-bts-sysmo the MPH INFO MEAS IND indication is still sent
separately. Lets merge the measurement information into the PH DATA

Change-Id: Iffe7865727fbf9bca8eb32a96e8ea05cf718a948
Related: OS#2977
2020-02-17 12:40:07 +01:00
Philipp Maier
ac61baed2e Do not depend on pcu_direct flag when populating ph_data_ind
The struct members ber10k, ta_offs_256bits and lqual_cb in ph_data_ind
are only populated when the pcu_direct flag is not set.

The pcu_direct flag is set when the pcu is directly attached to the phy
and all pcu related traffic (pdtch) is handled without sending it through
osmo-bts-sysmo. For those cases osmo_bts_sysmo will not make use of
those struct members, even if they were populated. When the PCU is not
directly attached the data is needed because it is sent through the
pcu_sock to the PCU.

Lets remove the check because it is not required. Also in future patches
where measurement indications and data / tch indicatins are merged the
struct members are also needed to carry the measurement information for
SACCH as well.

Change-Id: Iaa37bb62af4f5eb4b6e684cb754e68d11e6fd676
2020-02-17 12:11:43 +01:00
Pau Espin Pedrol
aea29c7249 l1sap: Change loglevel of Rx TCH.ind INFO->DEBUG
This line appears tens of times per second when a call is ongoing,
making it impossible to follow logs on INFO level.

Change-Id: Iadb1baf55df2f6d96f85260f2e8d03627fef7e66
2020-02-12 16:01:47 +01:00
Pau Espin Pedrol
52d7eafcea l1_if: Fix strange formatting of Meas info logging
Some use LOGPC, but were used after a LOGP with a trailing newline.
Let's simply add some defines/macros to be able to include it into a
normal LOGP easily insted of having a function.

Change-Id: Ie082b11c9d6d00ff2206184f03f6e3647c3da18c
2020-02-12 14:29:38 +01:00
Vadim Yanitskiy
cb69d607c9 osmo-bts-sysmo/Makefile.am: fix: do not overwrite bin_PROGRAMS
src/osmo-bts-sysmo/Makefile.am:25: warning: bin_PROGRAMS was already
				   defined in condition TRUE, which
				   includes condition ENABLE_SYSMOBTS_CALIB
src/osmo-bts-sysmo/Makefile.am:10: ... 'bin_PROGRAMS' previously defined here

Change-Id: Ib2334dccefd507eaaa6d33e58d4c1e029d7fd540
2020-01-21 18:52:08 +07:00
Philipp Maier
d4f67591c7 l1sap: merge MEAS IND into PRIM PH DATA / PRIM TCH
The MPH INFO MEAS IND indication, which contains the uplink measurement
data is sent in parallel to the PH DATA and TCH indications as a
separate indications. This makes the overall uplink measurement data
processing unnecessarly complex. So lets put the data that is relevant
for measurement into the PH DATA and TCH indications directly.

This change only affects osmo-bts-trx at the moment. In order to keep
the upper layers (l1sap.c) compatible we add an autodection to switch
between separate measurement indications and included measurement data.

Related: OS#2977
Depends: libosmocore I2c34b02d329f9df190c5035c396403ca0a4f9c42
Change-Id: I710d0b7cf193afa8515807836ee69b8b7db84a84
2020-01-20 14:35:19 +00:00
Philipp Maier
8969adc5d9 measurment: write irssi_full_sum variable correctly
The variable irssi_full_sum is not populated with a dummy value when we
are not able to compute irssi_full_sum. Instead we mistakenly write
MEASUREMENT_DUMMY_IRSSI to ber_full_sum, which is wrong

Change-Id: I44d7cb48e3c68ab1b48c78cceb9381ce3e39d7e8
Related: OS#2987
2020-01-20 14:33:51 +00:00
Philipp Maier
a0403d3769 ta_control: move timing advance code from osmo-bts-trx to common
The timing advance controller that is implemented in loops.c of
osmo-bts-trx only works for osmo-bts-trx and not for any of the phy
based bts. Lets move the timing advance controller into the common part
and make it available for every bts. Also lets add a unit-test.

Change-Id: If7ddf74db3abc9b9872abe620a0aeebe3327e70a
Related: SYS#4567
2020-01-20 14:33:49 +00:00
Vadim Yanitskiy
e7d835ca8c L1SAP: use LOGL_DEBUG for logging from rach_pass_filter()
Due to relatively small training sequence of Access Bursts, there
can be frequent false-positives (basically noise). Fortunately,
we can distinguish them from the real Access Bursts by checking
the signal measurements attached to them (BER, ToA and C/I).

Let's reduce verbosity of logging messages as they are mostly
useful for debugging and may confuse the users / operators.

Change-Id: I7ab6727ffff00140a7f9e762b299b711481393f1
2020-01-14 03:51:08 +07:00
Harald Welte
113712c728 rsl.c: Fix compiler error on gcc-9.2.1
rsl.c: In function ‘rsl_rx_ipac_XXcx’:
rsl.c:2147:39: error: ‘%s’ directive output may be truncated writing up to 255 bytes into a region of size 28 [-Werror=format-truncation=]
 2147 |   snprintf(cname, sizeof(cname), "bts@%s", ipstr);
      |                                       ^~
rsl.c:2147:3: note: ‘snprintf’ output between 5 and 260 bytes into a destination of size 32
 2147 |   snprintf(cname, sizeof(cname), "bts@%s", ipstr);
      |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Change-Id: Id982a814f401e304327d25c77666f039bc156c1f
2020-01-12 16:11:12 +01:00
Vadim Yanitskiy
e5711efbb5 common/abis.c: make use of RSL TEI from OML IPA RSL Connect
Change-Id: I5927f59a49724170a63e87be604973f7c9d5d8be
2020-01-11 00:51:43 +01:00
Vadim Yanitskiy
f9115ae67a common/vty.c: get rid of generic exit / end commands
Those commands are now handled by libosmovty itself.

Change-Id: I425f9058ae15de929e2ba0283d4057bdf767aeeb
2020-01-11 00:17:10 +01:00
Michael McTernan
b54f1bf122 measurement: use signed integer for division of ta256b_sum
The variable ta256b_sum is int32_t and num_ul_meas_actual is unsigned
int. When ta256b_sum is negative the division produces the wrong result.

This is beacuse the division is performed unsigned as the usual
arithmetic conversions promote to unsigned where both both operands are
the same width.

Lets fix this by casting num_ul_meas_actual to signed.

(Note that in the same function there are various other averages
computed in the same pattern, but they have unsigned operands and so are
correct.)

Related: SYS#4728
Change-Id: I37e3f69109c5ca2948bd4cdb7aa017bf2fcb8172
2020-01-06 12:07:23 +01: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
292 changed files with 34967 additions and 5701 deletions

26
.gitignore vendored
View File

@@ -19,11 +19,16 @@ 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/osmo-bts-sysmo
src/osmo-bts-sysmo/osmo-bts-sysmo-remote
@@ -40,6 +45,12 @@ 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
@@ -47,9 +58,11 @@ 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/ta_control/ta_control_test
tests/testsuite
tests/testsuite.log
@@ -73,3 +86,14 @@ 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

View File

@@ -1,23 +1,17 @@
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/osmo-bts-sysmo.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/sysmo/osmo-bts.cfg \
doc/examples/sysmo/sysmobts-mgr.cfg \
doc/examples/virtual/openbsc-virtual.cfg \
doc/examples/virtual/osmobts-virtual.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

View File

@@ -20,7 +20,7 @@ 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)
* software-defined radio based osmo-bts-trx (e.g. USRP B210, UmTRX, LimeSDR)
Homepage
--------
@@ -45,7 +45,7 @@ We provide a
as well as a
[VTY Reference Manual](http://ftp.osmocom.org/docs/latest/osmobsc-vty-reference.pdf)
and a
[Abis refrence MAnual](http://ftp.osmocom.org/docs/latest/osmobts-abis.pdf)
[Abis reference MAnual](http://ftp.osmocom.org/docs/latest/osmobts-abis.pdf)
describing the OsmoBTS specific A-bis dialect.
Mailing List
@@ -117,11 +117,3 @@ osmo-bts-octphy
* no clear indication of nominal transmit power, various power related
computations are likely off
* no OML attribute validation during bts_model_check_oml()
osmo-bts-trx
------------
* TCH/F_PDCH cannel not working as voice (https://osmocom.org/issues/1865)
* No BER value delivered to OsmoPCU (https://osmocom.org/issues/1855)
* No 11bit RACH support (https://osmocom.org/issues/1854)
* No CBCH support (https://osmocom.org/issues/1617)

View File

@@ -20,7 +20,7 @@ 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)
@@ -34,27 +34,82 @@ AC_HEADER_STDC
dnl Checks for typedefs, structures and compiler characteristics
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_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 >= 0.10.0)
PKG_CHECK_MODULES(LIBOSMOVTY, libosmovty >= 0.10.0)
PKG_CHECK_MODULES(LIBOSMOTRAU, libosmotrau >= 0.3.2)
PKG_CHECK_MODULES(LIBOSMOGSM, libosmogsm >= 0.10.0)
PKG_CHECK_MODULES(LIBOSMOCTRL, libosmoctrl >= 0.10.0)
PKG_CHECK_MODULES(LIBOSMOABIS, libosmoabis >= 0.3.2)
PKG_CHECK_MODULES(LIBOSMOCODEC, libosmocodec >= 0.10.0)
PKG_CHECK_MODULES(LIBOSMOCODING, libosmocoding >= 0.10.0)
PKG_CHECK_MODULES(ORTP, ortp)
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 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>])
# 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,
@@ -71,12 +126,12 @@ AC_ARG_ENABLE(octphy,
[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], $octsdr2g_incdir)
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 -I$OCTSDR2G_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS"
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])],
@@ -96,13 +151,6 @@ if test "$enable_octphy" = "yes" ; then
[],
[#include <octphy/octvc1/hw/octvc1_hw_api.h>])
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulSyncLossCnt],
AC_DEFINE([OCTPHY_USE_SYNC_LOSS_CNT],
[1],
[Define to 1 if your octphy header files renamed ulSyncLosseCnt to ulSyncLossCnt]),
[],
[#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],
@@ -124,6 +172,90 @@ if test "$enable_octphy" = "yes" ; then
[],
[#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
@@ -134,12 +266,12 @@ AC_ARG_ENABLE(litecell15,
[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], $litecell15_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 -I$LITECELL15_INCDIR -I$srcdir/include $LIBOSMOCORE_CFLAGS"
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>])
@@ -147,25 +279,98 @@ if test "$enable_litecell15" = "yes"; then
CPPFLAGS=$oldCPPFLAGS
fi
# Check for the sbts2050_header.h that was added after the 3.6 release
oldCPPFLAGS=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $LIBOSMOCORE_CFLAGS"
AC_CHECK_HEADER([sysmocom/femtobts/sbts2050_header.h],
[sysmo_uc_header="yes"],[])
CPPFLAGS=$oldCPPFLAGS
if test "$sysmo_uc_header" = "yes" ; then
AC_DEFINE(BUILD_SBTS2050, 1, [Define if we want to build SBTS2050])
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
AM_CONDITIONAL(BUILD_SBTS2050, test "x$sysmo_uc_header" = "xyes")
# 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
@@ -177,7 +382,13 @@ AC_OUTPUT(
tests/sysmobts/Makefile
tests/misc/Makefile
tests/handover/Makefile
tests/ta_control/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

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/sysmo/osmo-bts.cfg"], env = env,
"-c", "./doc/examples/sysmo/osmo-bts-sysmo.cfg"], env = env,
stdin=None, stdout=None)
time.sleep(1)

View File

@@ -1,10 +1,18 @@
#!/bin/sh
# this is a dispatcher script which will call the bts-model-specific
# script based on the bts model specified as command line argument
# 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
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
@@ -30,6 +38,10 @@ case "$bts_model" in
./contrib/jenkins_lc15.sh
;;
oc2g)
./contrib/jenkins_oc2g.sh
;;
trx)
./contrib/jenkins_bts_trx.sh
;;

View File

@@ -7,17 +7,15 @@
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmocore
osmo-build-dep.sh libosmocore "" --disable-doxygen
osmo-build-dep.sh libosmo-abis
cd "$deps"
# Get osmo-pcu for pcuif_proto.h
osmo-deps.sh osmo-pcu
configure_flags="\
--with-osmo-pcu=$deps/osmo-pcu/include \
--enable-sanitize \
--enable-werror \
--enable-trx \
"

View File

@@ -38,10 +38,25 @@ build_bts() {
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
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
}

View File

@@ -4,7 +4,7 @@
# shellcheck source=contrib/jenkins_common.sh
. $(dirname "$0")/jenkins_common.sh
osmo-build-dep.sh libosmocore
osmo-build-dep.sh libosmocore "" --disable-doxygen
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
@@ -14,7 +14,11 @@ osmo-build-dep.sh libosmo-abis
cd "$deps"
osmo-layer1-headers.sh lc15 "$FIRMWARE_VERSION"
configure_flags="--with-litecell15=$deps/layer1-headers/inc/ --enable-litecell15"
configure_flags="\
--enable-sanitize \
--with-litecell15=$deps/layer1-headers/inc/ \
--enable-litecell15 \
"
build_bts "osmo-bts-lc15" "$configure_flags"

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

View File

@@ -4,7 +4,7 @@
# shellcheck source=contrib/jenkins_common.sh
. $(dirname "$0")/jenkins_common.sh
osmo-build-dep.sh libosmocore
osmo-build-dep.sh libosmocore "" --disable-doxygen
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
@@ -14,7 +14,12 @@ osmo-build-dep.sh libosmo-abis
cd "$deps"
osmo-layer1-headers.sh oct "$FIRMWARE_VERSION"
configure_flags="--with-octsdr-2g=$deps/layer1-headers/ --enable-octphy"
configure_flags="\
--enable-sanitize \
--enable-werror \
--with-octsdr-2g=$deps/layer1-headers/ \
--enable-octphy \
"
build_bts "osmo-bts-octphy" "$configure_flags"

View File

@@ -7,19 +7,16 @@
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
osmo-build-dep.sh libosmocore
osmo-build-dep.sh libosmocore "" --disable-doxygen
osmo-build-dep.sh libosmo-abis
cd "$deps"
# Get osmo-pcu for pcuif_proto.h
osmo-deps.sh osmo-pcu
osmo-layer1-headers.sh oct "$FIRMWARE_VERSION"
configure_flags="\
--with-osmo-pcu=$deps/osmo-pcu/include \
--enable-werror \
--with-octsdr-2g=$deps/layer1-headers/ \
--enable-octphy \
--enable-trx \

View File

@@ -4,7 +4,7 @@
# shellcheck source=contrib/jenkins_common.sh
. $(dirname "$0")/jenkins_common.sh
osmo-build-dep.sh libosmocore
osmo-build-dep.sh libosmocore "" --disable-doxygen
export PKG_CONFIG_PATH="$inst/lib/pkgconfig:$PKG_CONFIG_PATH"
export LD_LIBRARY_PATH="$inst/lib"
@@ -16,13 +16,18 @@ 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-sysmocom-bts"
build_bts "osmo-bts-sysmo" "$configure_flags"
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
$MAKE -C contrib/sysmobts-calib
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/osmo-bts-sysmo -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

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

@@ -1,20 +0,0 @@
[Unit]
Description=sysmocom sysmoBTS
[Service]
Type=simple
ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness'
ExecStart=/usr/bin/osmo-bts-sysmo -s -c /etc/osmocom/osmo-bts.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
RestartSec=2
RestartPreventExitStatus=1
# The msg queues must be read fast enough
CPUSchedulingPolicy=rr
CPUSchedulingPriority=1
[Install]
WantedBy=multi-user.target
Alias=osmo-bts-sysmo.service

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 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

@@ -3,11 +3,8 @@ Description=osmo-bts for LC15 / sysmoBTS 2100
[Service]
Type=simple
ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/usr0/brightness'
ExecStartPre=/bin/sh -c 'echo 1 > /sys/class/leds/usr1/brightness'
ExecStart=/usr/bin/osmo-bts-lc15 -t 2 -s -c /etc/osmocom/osmo-bts.cfg -M
ExecStopPost=/bin/sh -c 'echo 1 > /sys/class/leds/usr0/brightness'
ExecStopPost=/bin/sh -c 'echo 0 > /sys/class/leds/usr1/brightness'
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

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

@@ -4,7 +4,7 @@ Description=osmo-bts for sysmocom sysmoBTS
[Service]
Type=simple
ExecStartPre=/bin/sh -c 'echo 0 > /sys/class/leds/activity_led/brightness'
ExecStart=/usr/bin/osmo-bts-sysmo -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

View File

@@ -3,7 +3,7 @@ Description=Osmocom osmo-bts for osmo-trx
[Service]
Type=simple
ExecStart=/usr/bin/osmo-bts-trx -s -c /etc/osmocom/osmo-bts.cfg
ExecStart=/usr/bin/osmo-bts-trx -s -c /etc/osmocom/osmo-bts-trx.cfg
Restart=always
RestartSec=2

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

765
debian/changelog vendored
View File

@@ -1,3 +1,768 @@
osmo-bts (1.2.0) unstable; urgency=medium
[ Oliver Smith ]
* Cosmetic: virtual: l1sap.c: fix typos
* virtual: set link quality for GSMTAP_CHANNEL_RACH
* pcu_sock: fix endian-swapped CellID
* gitignore: add oc2g generated files
* log: set L1 SAPI log context
* vty: add "logging filter l1-sapi"
* vty.c: don't ignore get_string_value() errors
* vty.c: avoid coverity BAD_SHIFT issues
* osmo-bts-virtual.cfg: ms-power-control dsp -> osmo
[ Harald Welte ]
* ETWS Primary Notification via P1 Rest Octets
* pcu_interface: Forward ETWS Primary Notification to PCU
* doc: Update Abis manual RSL section with ETWS related infomration
* osmo-bts-trx/scheduler: prevent uninitialized memory access
* osmo-bts-trx: migrate to new generic ECU abstraction
* rach_pass_filter(): Add information about channel type
[ Vadim Yanitskiy ]
* common/rsl.c: fix possible NULL-pointer dereference
* osmo-bts-trx/scheduler: fix tx_tch_common(): do not send AMR BFI twice
* osmo-bts-trx/scheduler: add FIXME note about FACCH/H and BFI
* osmo-bts-trx/scheduler: fix: check rc of osmo_ecu_frame_out()
* scheduler: fix handling of PTCCH/U and PTCCH/D logical channels
* osmo-bts-trx/scheduler: also detect TSC for Access Bursts on PDCH
* common/l1sap: increase ToA precision for packet Access Bursts
* L1SAP: use RSL_CHAN_* definitions from libosmogsm
* L1SAP: also consider RSL_CHAN_OSMO_CBCH8 as CBCH
* L1SAP: clarify debug messages in rach_pass_filter()
* L1SAP: do not pass unused parameter to l1sap_handover_rach()
* L1SAP: refactor handling of Access Bursts on PDCH
* L1SAP: properly handle 11-bit encoded RACH.ind in gsmtap_ph_rach()
* L1SAP: use the actual ARFCN for outgoing PCUIF messages
* L1SAP: fix gsmtap_pdch(): there can be no DATA.ind on PTCCH/U
* L1SAP: use GSMTAP_CHANNEL_PDTCH for PDTCH blocks by default
* L1SAP: there can be no DATA.ind primitives on PTCCH/U, reject them
* README.md: update osmo-bts-trx specific limitations
* osmo-bts-trx/scheduler: fix: print the last frame number in rx_data_fn()
* osmo-bts-trx: general handling of NOPE / IDLE indications
* osmo-bts-trx/trx_if.c: fix: always initialize bi->burst_len for NOPE.ind
* osmo-bts-trx/trx_if.c: also print both RSSI and ToA256 for NOPE.ind
* osmo-bts-trx/trx_if.c: fix: NOPE.ind also contains C/I field
* pcuif_proto.h: extend RACH.ind with TRX and timeslot number fields
* common/vty.c: fix: properly assert() the result of get_string_value()
* common/abis.c: pass gsm_bts_trx to e1inp_sign_link_create()
* common/abis.c: use tall_bts_ctx as talloc-context for libosmo_abis_init()
* osmo-bts-trx/vty: ensure backwards compatibility with older config files
[ Pau Espin Pedrol ]
* bts-trx: Log case where no SETFORMAT is sent
* bts-trx: Change super verbose IDLE ind not-supported line to DEBUG
* doc: bts-models.adoc: Fix typos in rts-advance section
* bts-trx: vty: Use API to get poweron state
* bts.h: Remove non-existent function definitions
* scheduler.c: Move some message log level to DEBUG
* scheduler: Use OSMO_ASSERT instead of abort
* l1sap: Log conn dropped due to radio link counter timeout
* struct gsm_bts: Add model_priv pointer handing bts_model specific data
* bts-trx: Allocate struct osmo_trx_clock_state as part of bts-trx private data
* bts-trx: vty: Print phy link state in cmd 'show transceiver'
* bts-trx: trx_set_bts(): Avoid double loop by checking current trx
* bts-trx: Rework code handling poweron state
* bts-trx: Don't reset transceiver_available in scheduler_trx.c
* bts-trx: Get rid of messy transceiver_available state handler
* bts-trx: Drop unused func check_transceiver_availability()
* bts-trx: Log TRXC and TRXD socket recv()/send() failures
* bts-trx: Time out if no clock ind recvd after RSP POWERON
* cosmetic: bts-trx: document variable power level
* bts-trx: loops.c: Take into account RSL CHAN ACT ms power level limits
* loops.h: Fix missing include for struct l1sched_trx
* power_control.c: Take into account RSL CHAN ACT ms power level limits
* cosmetic: l1sap.c: Fix typo
* rsl: Assign recv pwr to lchan's max ms power
* bts-trx: Implement MS Power control loop calculations using dBm instead of ctl levels
* rsl: Fix logged value in rx MS Power Control
* cosmetic: Fix trailing whitespace
* Change gsm_bts_trx field to bool and rename it
* Change gsm_lchan field fixed to bool
* rsl: Remove unneeded duplicate reset on some lchan fields
* Move and rename gsm_lchan.ms_power field
* bts-trx: loops.c: Avoid always clamping MS power to MS power class 1
* power_control.c: Apply latests improvements from loops.c
* power_control.c: Log rx current and target signal levels
* power_control.c: Fix ms pwr ctrl skipped if MS doesn't support announced MS Power Level
* Introduce BTS feature BTS_FEAT_MS_PWR_CTRL_DSP
* power_control.c: Don't use announced MS Power level as input for loop calculations
* power_control.c: Limit speed of announced MS Power Level value changes
* scheduler_trx.c: cast ptrdiff value to fix printf format
* bts-trx: Drop low layer MS Power Control Loop algo
* rsl_rx_chan_act: Apply bitmask when parsing IE MS_POWER
* rsl: Clarify when autnonoums MS Power Ctrl Loop is used
* power_control.c: Log maximum allowed MS Power Level
* power_control.c: Clarify loop algo vars and use correct ones during log
* l1sap: is_fille_frame(): verify len of data compared
[ Martin Hauke ]
* Fix common misspellings and typos
* Rename variable: CALIB_SUCESS -> CALIB_SUCCESS
[ Philipp Maier ]
* scheduler_trx: use gsm0502_fn_remap() to calculate frame number
* scheduler_trx: initalize n_errors, n_bursts_bits, n_bits_total
* scheduler_trx.c: avoid division by zero when calculating BER
* rsl: ensure measurement reports are sent
* l1sap.c: ensure ms power control loop is running
-- Pau Espin Pedrol <pespin@sysmocom.de> Fri, 03 Jan 2020 17:18:44 +0100
osmo-bts (1.1.0) unstable; urgency=medium
[ Daniel Willmann ]
* Rename oc2g config file to match new naming scheme
* dump_docs: Use new config file naming scheme
* systemd: Install OC2G service files with autotools
* doc/examples: Install OC2G config files with autotools
* osmo-bts-oc2g: Fix status LED responsibilities
* osmo-bts-lc15: Change LED behaviour to be the same as oc2g
* manuals: Add script to regenerate counter/vty documentation
* manuals: Add counter documentation
* manuals: Update vty documentation
[ Harald Welte ]
* Bump version: 0.8.1.199-5c93-dirty → 1.0.0
* scheduler_trx: Fix erroneous multiply-by-four
* OML: some more comments on what functions do
* OML: Return attributes in ACK/NACK messages
* OML: Ensure MOs are initialized with valid "Administrative State'
* OML: Don't overwrite MO instance before oml_tx_failure_event_rep()
* OML: remove double-logging on oml_tx_failure_event_rep()
* OML: send proper OML alerts in case of errors
* OML: Reduce code duplication in down_mom/down_fom
* OML: Report short messages even for invalid TRX numbers in down_fom()
* OML: Use 'const struct abis_oml_mo *' whenever users only read
* OML: Reject segmented OML messages
* OML: Properly reject short messages and truncate over-long messages
* OML: Work around OsmoBSC sending "GET ATTRIBUTES" with short length
* OML: Store merged attributes of IPA OML Managed Objects
* OML: Don't advertise baseband transceiver as UNLOCKED at startup
* OC-2G: Nominal transmit power is 25 dBm, not 40
* rsl.c: Add missing #include of gsm0808.h
* Forward GPRS SUSPEND REQ from DCCH to PCU socket
* handle NULL return from rate_ctr_group_alloc()
* rsl: Send RSL Error Report in case of unknown/unsupported msg_type
* rsl: Include Channel Nr and Link ID in Error reports whenever possible
* RSL: Reject RLL messages for lchans that are not active yet
* RSL: Fix off-by-one error when parsing SACCH INFO IE in RSL CHAN ACT
* cbch: Implement handling of "Schedule" message
* cbch: Refactor get_smscb_block() / remove smscb_msg.next_seg
* cbch: Log every RSL SMSCB COMMAND with type and number of blocks
* cbch: Implement support for DEFAULT message
* cbch: Fix memory leak and send error message on invalid SMSCB command
* cbch: Support Extended CBCH
* cbch: Keep SMSCB queue length counter
* manual: We now support RSL CBCH LOAD INDICATION
* manual: SMSCB BROADCAST COMMAND has no limitations anymore
* README.md: Mention LimeSDR as SDR device
* sysmo: Fix "nominal power" / BS power display in VTY
* cbch: Add counters; queue length limits and CBCH LOAD reporting
* cbch: Improve verbosity and extend logging; Always indicate BASIC/EXTD CBCH
* Use LOGPLCHAN whenever possible
* rsl.adoc: DELETE INDICATION is implemented since Feb '18
* RSL: Fix logic about fixed/dynamic MS power control in MS POWER COMMAND
* rsl: Implement parsing of BS Power Control message
* rsl: MS POWER COCNTROL isn't (only) about "forcing" power levels
* load_indication: Fix missing re-set of RACH parameters
* l1sap: Correctly count RACH slots in calc_exprd_rach_frames()
* l1sap: Fix calculation of expired RACH slots in case of missing frame numbers
* oml: Print more context from FOM Header or using MO
* oml: Have one generic log message for all transmitted messages
* Add severity to OML FAILURE EVENT REPORT
* Fix passing of RR SUSPEND REQ from DCCH to PCU socket
* clear GPRS indicator in SI3 while PCU is disconnected
* trx: Update documentation for fn-advance and rts-advance
* l1sap: Compute statistics on FN advance in PH-RTS.ind
* [correctly] use the LAPDm T200 values received via OML
* Update T200 timer default values
* lapdm: Use new libosmocore API to ensure per-channel-type N200 values
* sysmo/l1_if.c: Annotate fall-through in switch statement
* osmo-bts-trx: Don't increment rssi_valid_count twice
* osmo-bts-trx: Don't attemtp to adjust MS power if fixed
* scheduler_trx: Handle negative return of gsm0503_tch_hr_decode()
[ Vadim Yanitskiy ]
* common/vty.c: fix 'cfg_phy_no_inst_cmd' command description
* common/oml.c: fix: properly push abis_nm_ipa_magic
* common/pcu_sock.c: fix possible memleaks in pcu_sock_read()
* common/oml.c: constify argument 'trx' of handle_attrs_trx()
* common/oml.c: use proper NACK reason in oml_tx_attr_resp()
* common/oml.c: use proper OML object for Get Attribute Response
* common/oml.c: fix total length calculation in cleanup_attr_msg()
* common/l1sap.c: fix: add missing new line to a debug message
* common/rsl.c: fix size argument in memcmp() call
* common/rsl.c: fix unaligned pointers in rsl_add_rtp_stats()
* common/paging.c: fix unaligned pointer access
* common/oml.c: introduce and use both LOGPFOH and DEBUGPFOH
* common/oml.c: use proper format specifier for uint16_t
* common/oml.c: fix broken debug print in down_mom()
* common/oml.c: refactor Get Attribute Response message generation
* common/oml.c: fix: properly encode NM_ATT_SW_CONFIG
* osmo-bts-trx: distinguish 11-bit Access Bursts by synch. sequence
* osmo-bts-sysmo: fix: indicate BTS_FEAT_CBCH support on OML
* README.md: remove OS#1865 from 'Known limitations'
* common/rsl.c: fix NULL-pointer dereference in rsl_rx_rll()
* osmo-bts-trx/trx_if.c: dropping Tx bursts is a noticeable event
* osmo-bts-trx/l1_if.h: drop unused ho_rach_detect from trx_l1h
* osmo-bts/scheduler.h: cosmetic: use bool for ho_rach_detect
* common/rsl.c: RSL_IE_HANDO_REF is mandatory for handover CHAN ACT
* common/bts.c: bts_supports_cm(): take care about GSM48_CMODE_SIGN
* Use #define RSL_CHAN_RACH for RSL Channel Number of RACH
* common/scheduler.c: refactor description of TRXC_* lchans
* osmo-bts-trx/trx_if.c: use osmo_loadXXbe() for TDMA FN and ToA256
* osmo-bts-trx/trx_if.c: rename and clarify TRX_MAX_BURST_LEN
* osmo-bts-trx/trx_if.c: introduce TRXD header version handling
* osmo-bts-trx/trx_if.c: introduce TRXD header version 0x01 support
* osmo-bts-trx/trx_if.c: drop RSSI / ToA debugging code
* osmo-bts-trx/trx_if.c: properly describe TRXD messages in logs
* osmo-bts-trx/trx_if.c: add TRXD header version negotiation
* osmo-bts-trx/trx_if.c: encode actual TRXD header version
* osmo-bts-trx/scheduler: pass trx_ul_burst_ind to lchan handlers
* osmo-bts/scheduler: provide actual C/I values to OsmoPCU
* osmo-bts-trx/scheduler: rx_rach_fn(): use optional TSC info from TRX
* osmo-bts-trx/scheduler: rx_rach_fn(): clarify handover RACH handling
* osmo-bts-trx/scheduler: rx_rach_fn(): enrich debug message
* common/rsl.c: fix: properly handle SI3 Rest Octets
* Clarify and refactor link quality (C/I) handling
* Move Access Burst link quality handling to L1SAP
* osmo-bts-trx/scheduler: rx_rach_fn(): provide actual C/I ratio to L1SAP
* osmo-bts-trx/scheduler: rx_data_fn(): provide actual C/I ratio to L1SAP
[ Max ]
* osmo-bts-trx: add extended (11-bit) RACH support
* Log lchan kind on PCU-related error
* Enable statsd support
* Make gsm_pchan2chan_nr() static
* Constify pcu_rx_*() parameters
[ Philipp Maier ]
* scheduler_trx: use stored fn for pdtch data indications
* oc2g: remove unused define constant FACTORY_ROM_PATH
* lc15: remove unused define constant FACTORY_ROM_PATH
* oml: make oml_tx_failure_event_rep() public
* oc2gbts_mgr_vty: remove calls to vty_install_default()
* oc2g: l1if: delay trx initialization to avoid race condition
* oc2gbts_mgr: use msgb_talloc_ctx_init() instead of msgb_set_talloc_ctx()
* oc2g: generate failure event report in case of bad calibration
* oc2g: change log level for calibration file errors to FATAL
* vty: add function gsmnet_from_vty() to vty.h
* main: remove wrong call to oml_fail_rep() on SIGUSR1/2 and SIGABRT
* oml: use oml_tx_failure_event_rep() instead of oml_fail_rep()
* oml: use oml_tx_failure_event_rep() instead of signals to SS_FAIL
* l1_if: add include for missing header file
* oc2gbts_mgr_calib: don't use fsync() on *FILE pointer
* oc2gbts_mgr_calib: do not return NULL on integer function
* oc2gbts_mgr: use osmo_init_logging2() instead of osmo_init_logging()
* pcu_sock: use %zu conversion specifier for printing sizeof() result
[ Pau Espin Pedrol ]
* oc2g: Fix compilation error (comment mark inside comment)
* oc2g: Add get_hwversion_desc to header file
* oc2g: Cleanup of get_hwversion_desc
* oc2g: led_sleep_cb: pass correct ptr to llist_move_tail
* oc2g: fsync requires fd instead of file stream
* oc2g: Remove unused variables
* oc2g: Remove unused static function
* oc2g: vty: Compilation error fixes due to commented code
* contrib: Remove deprecated screen script helpers
* bts-trx: trx_if.c: Introduce logging macro LOGPPHI
* gsm_data_shared.h: Remove unused loc_list from struct gsm_bts
* bts: Bypass T200 DCCH values for CCCH
* bts-trx: Introduce VTY command osmotrx trxd-max-version
* trx: Use LOGPPHI instead of LOGP in some more messages
* Remove undefined param passed to {logging,osmo_stats}_vty_add_cmds
* configure.ac: Require libosmocore 1.2.0
[ Alexander Huemer ]
* Remove 11-bit RACH support from 'Known Limitations'
[ Oliver Smith ]
* debian: create -doc subpackage with pdf manuals
* Revert "debian: create -doc subpackage with pdf manuals"
* debian: create -doc subpackage with pdf manuals
* contrib/jenkins.sh: run "make maintainer-clean"
[ Neels Hofmeyr ]
* lc15,sysmo,oc2g: fix dsp-trace-flag command
[ Eric Wild ]
* revert changes to T200
* RSL: Fix fixed MS power control in RSL CHAN ACTIV
[ Thorsten Alteholz ]
* fix spelling stuff mentioned by lintian
-- Pau Espin Pedrol <pespin@sysmocom.de> Wed, 07 Aug 2019 15:59:02 +0200
osmo-bts (1.0.0) unstable; urgency=medium
[ Stefan Sperling ]
* let osmo-bts log a special notice if OML connection is closed early
* log reception of PCU_IF_MSG_PAG_REQ messages from osmo-pcu
* update sysinfo copies in all lchans upon SACCH FILL
* preserve lchan-specific SI overrides on SACCH FILL
* fix timespec subtraction in compute_elapsed_us()
* fix conditions for sending fill frames during RTS IND
* send TCH/F fill frames in DTX mode (WIP)
* Revert "send TCH/F fill frames in DTX mode (WIP)"
* prevent potential NULL dereference in virtbts's tx_tchh_fn
* properly initialize si3 in test_is_ccch_for_agch_setup()
* add missing check of osmo_wqueue_enqueue() return value
[ Harald Welte ]
* scheduler_trx: Add reminders to use libosmocore functions
* cosmetic: it's n_r in check_for_first_ciphrd(), not n_s
* Add min/max/std-dev measurement reporting for TOA256
* debian/rules: Don't overwrite .tarball-version
* CBCH: Fix rejecting SMS-CB related RSL messages
* [sysmo,lc15]: Consider CBCH channel combinations in chan_nr_by_sapi()
* CBCH: Move processing via L1SAP
* CBCH: Implement CBCH support for osmo-bts-{trx,virtual}
* CBCH: Use llist_first_entry_or_null() instead of reinventing it
* l1sap/scheduler: Consistently print chan_nr as hex number
* CBCH: Fix CBCH via L1SAP for osmo-bts-{sysmo,octphy,litecell15}
* get_lchan_by_chan_nr(): Fix resolution of CBCH
* CBCH: Add FIXME comments on queue overflow/underflow handling
* CBCH: sprinkle some OMSO_ASSERT() and guard against talloc failure
* CBCH: Fix CBCH implementation for osmo-bts-trx
* CBCH: Some more scheduler_mframe cleanup
* ensure all config file examples are well-formed
* lc15bts_mgr_vty: Ensure writing well-formed config files
* paging_test: Fix AGCH/PCH split test for second half of 102 multiframe
* Fix computing CCCH block number from frame number
* sysmo, virtual: properly handle BS-AG-BLKS-RES as received from BSC
* scheduler_trx.c: Switch to osmo_timerfd() of libosmocore >= 0.12.0
* initial checkin of manuals to public repo
* Add link to Asciidoc source code of manual
* spelling: message discriminator, not descriminator
* osmobts-abis: Add Revision log regarding dynamic cannels
* Documentation on AMR RTP in case of DTX
* rtp-amr.adoc: TCH/AFS Uplink
* rtp-amr.adoc: TCH/AFS Downlink: Inhibiting
* rtp-amr: TCH/AHS Uplink: FACCH/H During DTX
* rtp-amr.adoc: New TCH/AHS downlink chapters
* rtp-amr.adoc: Fixes to Message Sequence Charts
* update osmo-bts-virtual documentation, now that code is merged
* vty-ref: Update URI of docbook 5.0 schema
* osmo-bts-trx/loops.c: Add comments documenting TA + MS power control loop
* osmo-bts-trx/loops.[ch]: Make functions "void" if they always return 0
* osmo-bts-trx/loops.c: Use lchan name based logging
* osmo-bts-trx/loops.c: Make code control flow more readable
[ Philipp Maier ]
* rtp: make port range configurable, assign correct port numbers
* octphy: add support for 16x oversampling mode
* cosmetic: separate measurement testcase definitions
* cosmetic: unify measurement sample handling in one function
* measurement: make sure state is reset on chan act.
* measurement: make sure measurement interval end is detected
* measurement: fix measurement interval end detection
* osmo_mcast_sock: make sure SO_REUSEADDR is applied
* cosmetic: fix sourcecode formatting
* cosmetic: remove wrong comment
* measurement: add unit tests for is_meas_complete()
* measurement: fix sub frame table for TCH/H, SS1
* measurement: add unit tests for ts45008_83_is_sub()
* measurement: fix is_meas_overdue() and increase testcoverage
* cosmetic: rename *_meas_rep_fn10* to *_meas_rep_fn10*_by_*s
* cosmetic: test_is_meas_overdue() does not test is_meas_complete()
* measurement: substitue missing measurements
* measurement: add SUB measurements in test_lchan_meas_process_measurement
* paging: add unit-test to check different bs_ag_blks_res settings
* measurement: display fn_mod when measuremnet is added
* cosmetic: fix typo in comment
* measurement: remove missed interval end detection
* measurement: fix unit-test test_lchan_meas_process_measurement
[ Pau Espin Pedrol ]
* bts.c: Log name of RR msg type instead of value
* bts.c: Add missing include for gsm48_rr_msg_name
* bts_agch_enqueue: Decrease queue len hard_limit from 1000 to 100
* compact AGCH queue: Drop too msg diff than IMM_ASS_REJ
* Send DELETE_IND when dropping Imm Assign pending message
* lc15: Use correct type for hLayer1 field
* lc15: Fix incorrect cast of hLayer1
* pcu_sock: Log event pcu_sock created
* l1_if.c: Move decl of vars used in conditional macro
* sysmo: vty: Add missing include for lchan_deactivate
* sysmo: Fix memcmp in RF-MUTE.req for superfemto < 3.6.0
* sysmo: l1if_mute_rf: Declare vars inside ifdef section
* sysmo: l1_if.c: Avoid decl of unused vars and funcs with femtobts_v2.7 build
* sysmo: calib_file.c: Avoid decl of unused vars and funcs with femtobts_v2.7 build
* jenkins_*.sh: add --enable-werror to configure flags
* doc: Move calypsoBTS example into trx subdir
* build: Install example cfg files
* debian: Package installed example doc files
* Remove unneeded direct libortp dependency
* debian: Make osmo-bts-* packages conflict with old osmo-bts package
* debian: Create dbg package for osm-bts-virtual
* rsl: Use value_string to print encryption algo name
* l1sap: add_l1sap_header: Compact msgb_push ret assignment
* sched: Log RX->RTP packet like we do in add_l1sap_header
* scheduler: Log error on fn jump
* trx: scheduler: Keep RTP clock up to date while in DTXu pause
* Move systemd service to contrib/systemd
* Install systemd services with autotools
* Install sample cfg file to /etc/osmocom
* doc/examples/Makefile: Install bts-mgr cfg files used by systemd services
* lc15: vty: Add missing include for lchan_deactivate
* lc15: fsync requires fd instead of file stream
* lc15: rewrite and refactor code to print hwversion description
* lc15: led_sleep_cb: pass correct ptr to llist_move_tail
* abis: inp_s_cbfn: Improve logging signal related information
* lchan_meas_check_compute: Log value during incorrect num of SUB measurementes detected
* l1sap: Log name of chan_nr instead of hex value
* rsl_rx_chan-activ: Improve logging information
* gsm_pchan2chan_nr: Fix conversion of CCCH_LCHAN
* Convert lchan CCCH_LCHAN to chan_nr BCCH and viceversa
* {oc2g,sysmo}-mgr-calib: Fix build against gpsd >= 3.18
* bts: Allocate TRX for BTS dynamically, deprecate -t
* bts-trx: trx_if: Use struct to store CTRL msg parsed responses
* bts-trx: setup timer once at creation time
* common: Implement OML for trx_set_available(1)
* bts-trx: Allow re-try without exit if POWERON fails in osmo-trx
* bts: Fix TRX0 param initialization
* rsl: Log lchan state during dynts PDCH->TCH
* rsl: Avoid sending ipa PDCH DEACT NACK followed by ACK
* bts-trx: early return on POWERON success
* cosmetic: fix whitespace
* bts_model: Allow TS connect to be processed asynchronously
* OsmoBTS/chapters/configuration.adoc: Add bts index in example
* OsmoBTS: Update osmotrx ip to diff between local and remote
* rtp-amr: Describe requirement to recieve all PH-DATA.ind events
* rtp-amr: Fix typo and trailing whitespace
* Allow easily disabling GFDL references
* OsmoBTS: bts-models: Add Lime Microsystems devices as supported osmo-trx
* Introduce chapter trx_if.adoc and add it to OsmoTRX and OsmoBTS
* bts: Fix typo
* oc2g: Fix headers missing during make distcheck
* bts-trx: (n)ack PDCH DEACT only after TRX answered SETSLOT
* sysmobts_mgr: Prepare code for gpsd < 2.96 support
* sysmobts_mgr: Add support for gpsd < 2.96
* rsl: Send PDCH ACT NACK if TCH chan is still active
[ Vadim Yanitskiy ]
* Clarify frame loss counter for l1sched_chan_state
* osmo-bts-trx/l1_if.c: cosmetic: fix typo in debug msg
* common/rsl.c: tweak log message in lapdm_rll_tx_cb()
* contrib/jenkins_*.sh: drop rudimentary '--with-osmo-pcu'
* common/pcu_sock.c: cosmetic: explicitly address lchan
* common/scheduler.c: track TDMA frame loss per logical channels
* common/vty.c: fix deprecated osmo_str2lower() usage
* Fix deprecated gsm_arfcn2band(), use gsm_arfcn2band_rc()
[ Neels Hofmeyr ]
* cosmetic: abis.c: typo "exixt"
* fix ip.access dyn TS for osmo-bts-trx
* fix RSL Chan Mode Modif for dyn TS
* vty: mark 'rtp bind-ip' deprecated, not hidden
* Importing history from osmo-gsm-manuals
* OsmoBTS: typo x2 ('Objects Classes' -> 'Object Classes')
* OsmoBTS: fix typos, streamline language style
* OsmoBTS: s/content of this attribute/this attribute/
* OsmoBTS: explain IEs marked 'ignored' *and* 'Received'
* abis/oml.doc: remove duplicate sentence part
* OsmoBTS: typos
* OsmoBTS: wording tweak
* OsmoBTS: hardware support: remove dup, tweak wording
* Document dynamic channels on Abis, both IPA and Osmocom style
* OsmoBTS/abis/rsl: fix subtitle for ladder diagram of osmo dyn switchover
* OsmoBTS/abis/dyn_ts_osmocom_style.msc: adjust PDCH Act ack
* OsmoBTS/abis/rsl.adoc: fix missing section header
* OsmoBTS/chapters/dynamic-timeslots.adoc: Remove obsolete links
* osmobts-usermanual.adoc: fix link to abis.adoc chapter
* OsmoBTS/chapters/configuration.adoc: fix index numbering
* OsmoBTS/abis/rsl: cosmetic: 'IPA style'
* OsmoBTS/abis/rsl: add missing info for Osmocom Dyn Channels
* make clean: also remove generated image files
* add 'make check' target
* OsmoBTS/abis/rsl: combine separate dyn ts sections
* fix 'make clean': shell glob, ignore failure
* OsmoBTS/abis/rsl: split dyn TS ladder diagrams to fit on page
* fix build: abis: re-add dependencies
* dynamic timeslots: add BSC level config instructions
* refactor Makefile build rules, don't use the FORCE
[ Keith Whyte ]
* log: add error log for RSL Chan Mode Modif
* fix handling of odd pchans in bts_supports_cm()
[ Omar Ramadan ]
* Add OC-2G BTS sources
[ Max ]
* osmo-bts-trx: print TRX socket addresses in 'show transceiver'
* Fix type mismatch
* Drop unused function
* Add OsmoBTS control interface description
* Move RTP AMR doc to top level
* Add DTX implementation details to RTP AMR
* Sync DTX FSM with OsmoBTS code
[ Holger Hans Peter Freyther ]
* OsmoBTS: Fix the author name and mail address
[ Jonathan Brielmaier ]
* fix various typos across all manuals
[ Daniel Willmann ]
* Add section about configuring power-ramping
* OsmoBTS: Print VTY command in fixed-width font
* OsmoBTS: Fix typo
[ Alexander Couzens ]
* OsmoBTS: add vty reference documentation
* OsmoBTS: generate osmobts-abis.pdf again
[ Ivaylo Kostov ]
* BSC,BTS: add diagrams of PCU-BTS-NITB-SGSN relationships
[ Philipp ]
* Describe how to run multiple instances of osmo-nitb and osmo-bts
[ Oliver Smith ]
* build manuals moved here from osmo-gsm-manuals.git
* Fix DISTCHECK_CONFIGURE_FLAGS override
* contrib/jenkins_*.sh: build and publish manuals
* contrib: fix makedistcheck with disabled systemd
-- Harald Welte <laforge@gnumonks.org> Sun, 20 Jan 2019 21:13:37 +0100
osmo-bts (0.8.1) unstable; urgency=medium
[ Neels Hofmeyr ]
* cosmetic: dyn TS: clarify rsl_tx_rf_rel_ack() with a switch
* dyn TS: fix TCH/F_TCH/H_PDCH: properly record release of PDCH TS
* dyn TS: rx_rf_chan_rel: properly mark PDCH rel when no PCU, clarify
* dyn TS: clear TCH state upon reconnecting as PDCH
* cosmetic: dyn TS: clarify chan_nr composition
* ignore RSL RF CHAN REL for inactive lchans
* fix RSL Chan Activ Nack messages
* ip.access dyn ts: properly NACK a PDCH ACT on a still active lchan
* add/improve various logging around dyn ts
* dyn TS: be less strict on chan_nr, to allow arbitrary pchan switches
[ Stefan Sperling ]
* send a State Changed Event Report when rf is locked/unlocked
[ Harald Welte ]
* rsl: log errors when parsing of encryption information fails
* rsl: Make channel activation fail if encryption algorithm not supported
* rsl: Properly NACK CHAN_ACKT / MODE_MODIFY
* rsl: If CHAN ACT or MODE MODIF fails, send respective NACK
* osmo-bts-trx: Enable A5/3 cipher support
-- Pau Espin Pedrol <pespin@sysmocom.de> Tue, 15 May 2018 14:08:47 +0200
osmo-bts (0.8.0) unstable; urgency=medium
[ Neels Hofmeyr ]
* vty: skip installing cmds now always installed by default
* jenkins_common.sh: fix build_bts distcheck for more than one conf_flag
* fix build: tests/sysmobts: add missing -I$(SYSMOBTS_INCDIR)
* fix handover: handle_ph_ra_ind(): evaluate ra_ind before msgb_trim()
* implement support for 3-digit MNC with leading zeros
* configure: add --enable-werror
* use osmo_init_logging2() with proper talloc ctx
[ Pau Espin Pedrol ]
* lc15: Fix cfg indentation
* l1sap: Fix abort on big RTP packet received
* bts-trx: trx_ctrl_cmd: Simplify var assignment logic
* bts-trx: Avoid enqueueing consecutive duplicate messages to TRX
* Fix malformed Resource Indication packet
* debian/control: Remove uneeded dep libosmo-netif-dev
* jenkins.sh: Disable building doxygen for deps
* oml.c: Fix use of htons instead of ntohs
* bts-trx: trx_if.c: Log timedout+retransmitted CMD
* bts-trx: trx_if.c: trx_ctrl_read_cb: Move error handling to end of func
* bts-trx: trx_if.c: Improve parsing of received RSP messages from TRX
* bts-trx: Detect duplicated responses for retransmitted commands
* gsm_pchan2chan_nr: move warning to pragma message and track issue
* Remove unused variables
* bts-trx: scheduler_trx.c: Fix missing header
* l1sap.c: l1sap_tch_rts_ind: Remove unused variables
* octphy: octpkt.c: Remove unused static functions
* vty.c: Remove warning message
* virtual: l1_if.c: Remove unneeded warning message
* main.c: bts_main: fix typo in error message
* l1sap: Validate incoming RTP payload, drop bw-efficient AMR
* l1sap: Avoid assumption that l1sap is at head of msgb
* contrib: jenkins_bts_model: Fix bashism expr
* Include missing headers for osmo_init_logging2
* common/sysinfo.c: Fix no return on on-void function
* gsm_data_shared.h: Remove unused enum gsm_paging_event
* scheduler_trx: Fix signed integer overflow in clock calculations
[ Harald Welte ]
* trx: Better be safe than sorry before calling strlen
* trx: Avoid NULL+1 dereference in trx_ctrl_read_cb()
* trx: Don't call osmo_fr_check_sid with negative 'rc'
* trx: Don't assume phy_instance_by_num() returns non-NULL
* l1sap: fix wrong return value of is_fill_frame()
* measurement.c: Fix various typos in comments
* Comments on individual members of struct gsm_abis_mo
* scheduler: Harmonize log line format; Always print TS name + decoded FN
* scheduler_trx: L1P is for PH (data), L1M for MPH (control)
* l1sap: Fix log subsystem: Use DRTP for RTP related bits, L1C for MPH
* measurment.c: Introduce INFO category for DMEAS logging
* osmo-bts-octphy: Remove bogus warning about BS_AG_BLKS_RES
* rsl.c: Log RTP socket related errors as DRTP, not DRSL
* Put useful information in RTCP SDES.
* osmo-bts-trx: Fix reported frame number during PRIM_INFO_MEAS
* DTX: avoid illegal character contained in DTX FSM allocation which causes BTS crash
* gsm_lchan: remove unused member fields
* Add 'show (bts|trx|ts|lchan)' commands
* Print much more information during 'show lchan'
* vty: don't print "Bound IP / Port" if it isn't bound [yet]
* osmo-bts: Add talloc context introspection via VTY
* sysmo: Fix compiler warnings in eeprom.c
* sysmo+lc15: Add missign include for readv/writev
* trx: make l1if_fill_meas_res() static
* RSL: Properly reject RSL CHAN_NR IE for incompatible PCHAN
* RSL: Ensure we don't accept DCHAN messages for CCHAN
* osmo-bts-virtual: Shut down gracefully on socket creation failure
* osmo-bts-virtual: Generate PRIM_INFO_MEAS (with bogus values)
* Introduce + use LOG/DEBUGP with frame number prefixing/printing
* osmo-bts-virtual: Make use of LOGL1S() macro for context
* osmo-bts-virtual: Make sure PRIM_INFO_MEAS have non-zero frame number
* scheduler.c: Factor out find_sched_mframe_idx() function
* scheduler: add trx_sched_is_sacch_fn() function
* Revert "measurement: fix measurement computation"
* measurement.c: Hand Frame Number into measurement computation
* l1sap: Pass is_sub from L1 primitive into the Uplink Measurement
* osmo-bts-trx: Add missing frame number to l1if_process_meas_res()
* scheduler.c: Print message when burst substitution happens
* load_indication: Fix start of load indication timer
* RSL: Implement DELETE INDICATION on AGCH overflow
* RSL: Send ERROR REPORT on too short/truncated messages + wrong discriminator
* BTS: add rate_ctr about CCCH (paging, agch, pch)
* paging: Drop + Log paging requests for non-existant paging groups
* paging.c: Fix encoding of optional Mobile ID RR PAGING TYPE 1 / 2
* rsl: Improve ERROR REPORTing
* paging: Fix encoding of PAGING TYPE 3 Rest Octets
* RSL IPA DLCX: Avoid null-pointer dereference
* RSL: Fix encoding of ConnectionID in IPA_DLCX_ACK
* RSL IPA DLCX: Avoid another null-pointer dereference
* measurement.c: Fix sdcch4_meas_rep_fn102 / sdcch8_meas_rep_fn102
* counters: split rach:sent into rach:drop, rach:ho, rach:cs and rach:ps
* octphy: Remove code duplication for BER / RSSI conversion
* {sysmo,lc15}: Correctly report BER to L1SAP in INFO_MEAS_IND
* {sysmo,lc15}: Fix RACH reporting in combined CBCH case
* split scheduler_mframe.c from scheduler.c
* measurement: Compute RX{LEV,QUAL}-SUB for SDCCH and non-AMR TCH
* measurement.c: Don't silently copy "FULL" measurements to "SUB"
* scheduler: Add missing \n at end of LOG statement
* Move rach_busy counting above L1SAP
* RACH decoding: Use BER threshold for RACH ghost detection
* trx/scheduler: Use integer math for TOA (Timing of Arrival)
* measurement.c: higher-precision TA/TOA math
* L1SAP: Increase resolution of reported burst timing
* measurement: Keep average of high-accurate ToA value in lchan
* Add high-accuracy ToA value to Uplink Measurement Reports
* pcu_sock: Discard messages that are too short
* pcu_sock: Don't overflow the timeslot array
* pcu_sock: Log an error message and discard PCU primitives for BTS != 0
* pcu_sock: LOG + drop DATA.req from PCU for non-PDCH timeslot
* pcu_sock: LOG + drop PCU DATA.req for inactive lchan
* sysinfo.c: SI1 is optional; Send SI2 at TC=0 if no SI1 exists
* sysmobts: Compatibility with older firmware versions
* cosmetic: Document some SI scheduling related function API
* sysinfo: Fix scheduling of downlink SACCH information
* gsm_data_shared: Remove unused definitions/members/functions
* cosmetic: Move agch_queue to sub-structure of gsm_bts_role_bts
* Get rid of 'struct gsm_bts_role_bts'
* virtual: Correctly set+report BTS variant in OML attributes
* Add 'osmo-bts-omldummy' to bring up only OML without RSL
* fix inverted logic bug in omldummy patch
* omldummy: Suppress RSL transmission errors
* debian: Split osmo-bts-virtual from osmo-bts-trx
* fox chan_nr_is_dchan() for RSL_CHAN_OSMO_PDCH
* rsl_tx_dyn_pdch_ack: Add missing FRAME_NR information element
* fix activation of osmocom-style dynamic PDCH as TCH/F or TCH/H
[ Philipp Maier ]
* octphy: override firmware version check
* cosmetic: meas_test: fix section comment
* cosmetic: tests/Makefile.am: remove excess whitespace
* cosmetic: tests/power: remove unused var "ret"
* cosmetic: tests/agch: remove unused var "static_ilv"
* octphy: l1_oml: check returncode of trx_by_l1h()
* meas_test: fix header file references
* rsl: fix double-free in rsl_rx_mode_modif()
* fix nullpointer deref in rsl_tx_mode_modif_nack()
* rsl: do not allow MODE MODIFY request with unsupp. codec/rate
* gsm_data_shared: extend bts feature list with speech codecs
* octphy: ensure all BTS models set features
* vty: display bts features in vty command show bts
* bts: use feature list instead of speech codec table
* octphy: replace #warning with #pragma message
* ipac: fix log output
* rsl: remove unused variable
* l1_tch: remove dead code
* cosmetic: remove dead code
* cosmetic: remove unused variable
* cosmetic: remove unused variable in osmo-bts-omldummy/main.c
* octphy: integrate octasics latest header release
* osmo-bts-trx: perform error concealment for FR frames
[ Max ]
* Remove leftover comments and checks
* Log filenames on L1 errors
* Add --enable-sanitize configure option
* Use existing function to obtain TSC
* Remove BSC-specific parts
* Print FN delta on L1 errors
* Move sysmobts-calib into osmo-bts-sysmo
* Allow specifying sysmocom headers explicitly
* fix build: tests/misc: missing libosmo-abis and -trau flags
* Enable optional static builds
* Remove unneeded LIBOSMOCORE_CFLAGS from tests
* sysmobts: use proper includes for sbts2050 test
* Move -I inside *INCDIR variable
* sysmobts: remove weird default header location
* sysmobts: move header check to appropriate place
* CI: drop unused OsmoPCU dependency
* Enable sanitize for CI tests
* Add helper to get BCC from BSIC
* osmo-bts-trx: init nbits to know value
* osmo-bts-trx: ignore frame offset error on startup
[ Vadim Yanitskiy ]
* doc/examples: add CalypsoBTS configuration example
* common/pcu_sock.c: fix double field assignment
* scheduler_trx.c: remove ToA (Time of Arrival) hack
* common/l1sap.c: increase the BTS_CTR_RACH_DROP in RACH BER check
* common/l1sap.c: increment valid RACH counter after all checks
* common/l1sap.c: clean up noise / ghost RACH filtering
* common/l1sap.c: perform noise / ghost filtering for handover RACH
* common/l1sap.c: limit the minimal ToA for RACH bursts
* common/vty.c: remove unused variables
* common/main.c: track talloc NULL contexts by default
[ Alexander Huemer ]
* cosmetic: Makefile.am whitespace
* various Makefile.am: add missing CFLAGS
* gitignore: add missing entries
[ Stefan Sperling ]
* Cosmetic fixes for power ramping code.
* respond with NACK for non-hopping BTS with multiple ARFCN
* cosmetic: fix typos in src/common/oml.c
* return NACK codes instead of errno values from oml_tx_attr_resp()
[ Alexander Couzens ]
* pcuif_proto: correct indention of gsm_pcu_if_data
* pcu_if: move definition PCU_SOCK_DEFAULT into pcuif_proto.h
* pcuif_proto: add version 8 features
[ Keith ]
* osmo-bts-sysmo eeprom.c Restore ability to read/write EEPROM
-- Pau Espin Pedrol <pespin@sysmocom.de> Thu, 03 May 2018 17:02:19 +0200
osmo-bts (0.7.0) unstable; urgency=medium
[ Max ]

31
debian/control vendored
View File

@@ -10,10 +10,9 @@ Build-Depends: debhelper (>= 9),
pkg-config,
libosmocore-dev,
libosmo-abis-dev,
libosmo-netif-dev,
libgps-dev,
libortp-dev,
txt2man
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
@@ -21,6 +20,7 @@ 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
@@ -33,3 +33,28 @@ 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.

1
debian/osmo-bts-doc.install vendored Normal file
View File

@@ -0,0 +1 @@
usr/share/doc/osmo-bts-doc/*.pdf

View File

@@ -1,2 +1,5 @@
etc/osmocom/osmo-bts-trx.cfg
lib/systemd/system/osmo-bts-trx.service
usr/bin/osmo-bts-trx
usr/bin/osmo-bts-virtual
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

12
debian/rules vendored
View File

@@ -12,14 +12,11 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all
dh $@ --with=systemd --with autoreconf --fail-missing
override_dh_strip:
dh_strip --dbg-package=osmo-bts-trx-dbg
override_dh_autoreconf:
echo $(VERSION) > .tarball-version
dh_autoreconf
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
dh_auto_configure -- --enable-trx --with-systemdsystemunitdir=/lib/systemd/system --enable-manuals
override_dh_clean:
dh_clean
@@ -30,3 +27,6 @@ override_dh_clean:
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

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

@@ -3,41 +3,41 @@
!!
!
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
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
threshold warning min 17500
threshold critical min 19000
limits tx0_vswr
threshold warning max 1000
threshold warning max 1000
limits tx1_vswr
threshold warning max 1000
threshold warning max 1000
limits supply_pwr
threshold warning max 110
threshold critical max 120
threshold warning max 110
threshold critical max 120
limits pa0_pwr
threshold warning max 50
threshold critical max 60
threshold warning max 50
threshold critical max 60
limits pa1_pwr
threshold warning max 50
threshold critical max 60
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

@@ -0,0 +1,33 @@
!
! 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 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
!
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

@@ -29,15 +29,10 @@ line vty
!
phy 0
instance 0
trx-calibration-path /mnt/rom/factory/calib
phy 1
instance 0
trx-calibration-path /mnt/rom/factory/calib
trx-calibration-path /mnt/rom/factory/calib
bts 0
band 900
ipa unit-id 1500 0
oml remote-ip 192.168.234.185
oml remote-ip 10.42.0.1
trx 0
phy 0 instance 0
trx 1
phy 1 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

@@ -3,18 +3,18 @@
!!
!
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
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

View File

@@ -1,31 +0,0 @@
!
! 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,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

@@ -1,29 +0,0 @@
!
! 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

@@ -3,19 +3,19 @@
!!
!
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
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

View File

@@ -0,0 +1,37 @@
!
! 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 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,33 @@
!
! 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 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

@@ -1,34 +0,0 @@
!
! 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

@@ -3,49 +3,49 @@
!!
!
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
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
!

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

View File

@@ -1,61 +0,0 @@
!
! 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 dsp
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 through 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 through 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

View File

@@ -0,0 +1 @@
<vtydoc xmlns='urn:osmocom:xml:libosmocore:vty:doc:1.0'/>

File diff suppressed because it is too large Load Diff

View File

@@ -6,7 +6,7 @@ The start-up procedure of OsmoBTS can be described as follows:
|===
| bts-specific | main() |
| common | bts_main() | initialization of talloc contexts
| common | bts_log_init() | initialization of logging
| common | osmo_init_logging2() | 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
@@ -22,7 +22,7 @@ The start-up procedure of OsmoBTS can be described as follows:
| common | bts_controlif_setup() | Initialization of Control Interface
| bts-specific | bts_model_ctrl_cmds_install()
| common | telnet_init() | Initialization of telnet interface
| common | pcu_sock_init() | Initializaiton of PCU socket
| 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

View File

@@ -2,4 +2,4 @@ noinst_HEADERS = abis.h bts.h bts_model.h gsm_data.h gsm_data_shared.h logging.h
oml.h paging.h rsl.h signal.h vty.h amr.h pcu_if.h pcuif_proto.h \
handover.h msg_utils.h tx_power.h control_if.h cbch.h l1sap.h \
power_control.h scheduler.h scheduler_backend.h phy_link.h \
dtx_dl_amr_fsm.h
dtx_dl_amr_fsm.h ta_control.h

View File

@@ -1,6 +1,7 @@
#ifndef _BTS_H
#define _BTS_H
#include <osmocom/core/rate_ctr.h>
#include <osmo-bts/gsm_data.h>
enum bts_global_status {
@@ -9,21 +10,29 @@ enum bts_global_status {
BTS_STATUS_LAST,
};
enum {
BTS_CTR_PAGING_RCVD,
BTS_CTR_PAGING_DROP,
BTS_CTR_PAGING_SENT,
BTS_CTR_RACH_RCVD,
BTS_CTR_RACH_DROP,
BTS_CTR_RACH_HO,
BTS_CTR_RACH_CS,
BTS_CTR_RACH_PS,
BTS_CTR_AGCH_RCVD,
BTS_CTR_AGCH_SENT,
BTS_CTR_AGCH_DELETED,
};
extern void *tall_bts_ctx;
int bts_init(struct gsm_bts *bts);
int bts_trx_init(struct gsm_bts_trx *trx);
void bts_shutdown(struct gsm_bts *bts, const char *reason);
struct gsm_bts *create_bts(uint8_t num_trx, char *id);
int create_ms(struct gsm_bts_trx *trx, int maskc, uint8_t *maskv_tx,
uint8_t *maskv_rx);
void destroy_bts(struct gsm_bts *bts);
int work_bts(struct gsm_bts *bts);
int bts_link_estab(struct gsm_bts *bts);
int trx_link_estab(struct gsm_bts_trx *trx);
int trx_set_available(struct gsm_bts_trx *trx, int avail);
void bts_new_si(void *arg);
void bts_setup_slot(struct gsm_bts_trx_ts *slot, uint8_t comb);
int bts_agch_enqueue(struct gsm_bts *bts, struct msgb *msg);
struct msgb *bts_agch_dequeue(struct gsm_bts *bts);
@@ -32,6 +41,7 @@ int bts_ccch_copy_msg(struct gsm_bts *bts, uint8_t *out_buf, struct gsm_time *gt
int is_ag_res);
uint8_t *bts_sysinfo_get(struct gsm_bts *bts, const struct gsm_time *g_time);
void regenerate_si3_restoctets(struct gsm_bts *bts);
uint8_t *lchan_sacch_get(struct gsm_lchan *lchan);
int lchan_init_lapdm(struct gsm_lchan *lchan);
@@ -39,11 +49,15 @@ void load_timer_start(struct gsm_bts *bts);
uint8_t num_agch(struct gsm_bts_trx *trx, const char * arg);
void bts_update_status(enum bts_global_status which, int on);
int trx_ms_pwr_ctrl_is_osmo(struct gsm_bts_trx *trx);
bool trx_ms_pwr_ctrl_is_osmo(struct gsm_bts_trx *trx);
struct gsm_time *get_time(struct gsm_bts *bts);
int bts_main(int argc, char **argv);
#endif /* _BTS_H */
int bts_supports_cm(struct gsm_bts *bts, enum gsm_phys_chan_config pchan,
enum gsm48_chan_mode cm);
int32_t bts_get_avg_fn_advance(struct gsm_bts *bts);
#endif /* _BTS_H */

View File

@@ -14,6 +14,7 @@ struct phy_instance;
/* BTS model specific functions needed by the common code */
int bts_model_init(struct gsm_bts *bts);
int bts_model_trx_init(struct gsm_bts_trx *trx);
int bts_model_check_oml(struct gsm_bts *bts, uint8_t msg_type,
struct tlv_parsed *old_attr, struct tlv_parsed *new_attr,
@@ -59,6 +60,6 @@ void bts_model_phy_link_set_defaults(struct phy_link *plink);
void bts_model_phy_instance_set_defaults(struct phy_instance *pinst);
int bts_model_ts_disconnect(struct gsm_bts_trx_ts *ts);
int bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan);
void bts_model_ts_connect(struct gsm_bts_trx_ts *ts, enum gsm_phys_chan_config as_pchan);
#endif

Some files were not shown because too many files have changed in this diff Show More