Commit Graph

2054 Commits

Author SHA1 Message Date
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