Commit Graph

1343 Commits

Author SHA1 Message Date
Max 871e0bec7e OML: internalize failure reporting
* make oml_tx_failure_event_rep() static and use osmo_signal_dispatch()
  wrapped into oml_fail_rep() to trigger event reports outside of oml.c
  instead of directly calling into OML layer
* remove unnecessary formatting from text messages

Related: OS#1615
Change-Id: I738555c547926e97b325ab53763c0076c42309bc
2017-01-25 13:24:52 +01:00
Holger Hans Peter Freyther 10b11325a7 build: Do not require more headers from OpenBSC
There should be no other OpenBSC headers included and nobody is using
bsc_controlif_setup. Remove the include. This was introduced in
4723a19508.

Change-Id: I581f938e8fe9161b1d7076cedd74ff192cea86b2
2017-01-24 14:56:44 +01:00
Holger Hans Peter Freyther 8be9d7a6fe debian: Use the header files installed by openbsc-dev
Use --with-openbsc= to pick up gsm_data_shared.h coming from the
openbsc-dev package. With the revert of the change
Iec6b0f0eb0b7fffaa814c9769c0ee777d641a07f, packaging could work
now.

Change-Id: Ie0a005315454a6450205ce6fd76242b85405de8d
2017-01-24 13:16:29 +00:00
Holger Freyther ea5ccfa481 Revert "deb: use gsm_data_shared.* from openbsc-dev"
As the Osmocom project is providing packages and we build them
directly from git we should have native packages. openbsc-dev
should provide files in the same directory structure as the git
repository and then --with-openbsc=/usr/src/osmocom/openbsc/openbsc/include/openbsc
can be used. Follow up patches are coming.

This reverts commit 70b71507c2.

Change-Id: I8bc3a5c2b9446d9e94e362ed5d85a61e3a727f8b
2017-01-24 13:16:21 +00:00
Philipp Maier 2b763cc30c octphy: set tx attenuation via VTY
add code to configure the transmision power via VTY

Change-Id: I76bb8660eb1d8baeb6b8f69da4a6ba9ab7319981
2017-01-23 12:23:17 +00:00
Max 70b71507c2 deb: use gsm_data_shared.* from openbsc-dev
Use gsm_data-shared.* from absolute path where it's installed by
openbsc-dev package instead of relative path to fix OBS package
building.

Change-Id: Iec6b0f0eb0b7fffaa814c9769c0ee777d641a07f
Related: OS#1860
2017-01-20 12:20:14 +01:00
Philipp Maier c37fd88985 l1sap: fix missing 'else's causing wrong rach frame expiry counts
This bug was introduced in the recently merged
commit 1e399f888e
aka change-id I87f40f5f160a4f6750c4f3d06997fc4f24049303

Fixes: coverity-scan CID#160156 and CID#160155
Change-Id: I88ed1b3e59213acdf97f88eda097b8172b952a5e
2017-01-16 23:38:30 +00:00
Philipp Maier 1e399f888e l1sap: Fix expired rach slot counting
The counting of the expired rach slots in l1sap.c is not correctly
implemented. This commit fixes the implementation. The expired
rach slots are now conted correctly according to the configured
channel combination. If a CCCH and SDCCH are combined, only the
frames related to rach slots are counted.

Change-Id: I87f40f5f160a4f6750c4f3d06997fc4f24049303
2017-01-12 23:36:04 +00:00
Jean-Francois Dionne 0e5b12f981 lc15,sysmobts l1_if: fix memleak in handle_mph_time_ind()
Change-Id: I3061060235a488b114b636b3af9a2253a94de1e8
2017-01-12 11:13:35 +00:00
Max df75195666 scheduler: log lchan on which prim error occured
Log both lchan and trx_chan_type (using introduced value_string).

Change-Id: I80c581b54eeee371ee524a75a400d1e9ece16c68
2017-01-10 23:29:06 +00:00
Jean-Francois Dionne b76043e6f4 DTX: fix SID-FIRST detection
Max's note: made similar modification to osmo-bts-sysmo/tch.c

Change-Id: I76e62783b73803dfc0d32693a68020a9d89878b8
Related: OS#1801
2017-01-10 23:28:19 +00:00
Max de6d25e21d Remove obsolete define TLVP_PRES_LEN
The libosmocore version required by configure.ac already has
TLVP_PRES_LEN anyway.

Change-Id: I3e33d9d1a6160ea17ab0a875c65a98129e3d19c1
2017-01-10 17:18:05 +01:00
Philipp Maier 4723a19508 CTRL: make the CTRL-Interface IP address configurable
Currently the IP address where the control interface is bound
to is hardcoded to 127.0.0.1. This leads to problems with
multiple instances on one and the same machine. This commit
integrates the ctrl interface bind option into the VTY, so
that we can bind the ctrl interface to any IP address, just
like we do it with the VTY already.

Change-Id: If51e0c645c0789a4f4a8c51737fb81fb12f80829
2017-01-10 15:45:59 +00:00
Philipp Maier 962b33ea9d OML: fix possible segfault: add NULL check in oml_ipa_set_attr()
oml_ipa_set_attr() is using gsm_objclass2mo() to determine the
*mo object. However, it is possible that gsm_objclass2mo() returns a
null-pointer. The code following up is using *mo without checking.
Reject instead of dereferencing a NULL *mo.

Fixes: coverity scan CID#159533
Change-Id: Ia2cc9bc504c46ca3843c43d712cd8649bfae9526
2017-01-10 14:14:51 +00:00
Philipp Maier 563b744b38 RSL: add assertions to check args of public API
The public functions in rsl.c do not check for null pointers,
add assertions to catch null pointers early.

Change-Id: I63f127ce70a4127180f90238f564b63e355216ec
2017-01-10 14:13:56 +00:00
Philipp Maier 792573dc97 RSL: drop obsolete NULL check
rsl_rx_paging_cmd() checks if the pointer *trx is NULL, this check
does not make much sense since *trx has already been dereferenced
without checking earlier in the code. Furthermore *trx is also a
mandatory parameter which must not be NULL.

Fixes: coverity scan CID#159534
Change-Id: I17dfb42ff404b2a1e18354fb7a7278089b407a79
2017-01-10 11:53:50 +00:00
Max ec11a85929 Alarm on various errors
Send OML Failure Report for unsupported BTS attributes and other errors.

Change-Id: Ic163bcfb6361a8ebd39e0bc0f238ef51e2cb214e
Related: OS#1615
2017-01-08 11:09:58 +00:00
Max c038cb7903 Add Abis OML failure event reporting
Send 3GPP TS 12.21 § 8.8.2 Abis/OML failure event report.

Change-Id: Ib1170edca2207752984a554d7a6a57c224f6d5f5
Related: OS#1615
2017-01-08 11:03:39 +00:00
Max 94dd5060c8 Log socket path on error
Change-Id: If912ac0bc815986de2a231facb5cf317a677be68
2017-01-06 17:30:01 +01:00
Max 2cf6b73a42 Move code to libosmocore
With libosmocore commits I9c3bc15662949654e7bba6aad5488c69ee7d0c45 and
Ieaaaed19da9c069fe451faa53d24c5b84d7d5615 functions to copy and merge
parsed TLV were added as well as abis_nm_att_tlvdef_ipa TLV definition
with related enums. Hence we can remove it from here.

Change-Id: Ia4980062ea88ffe9019b201f84e92e006ae3c2e3
2017-01-06 12:24:42 +01:00
Max f3763590bd Add copyright for .deb packages
Add debian/copyright in Debian format which should have been added in
c2ecca6b04.

Change-Id: I4c7ef1286ba6d2f3c6aadc8ea1864be513f8cf1d
Related: OS#1694
2017-01-06 10:33:06 +00:00
Neels Hofmeyr bfd42c2b0a fix: dyn ts: uplink measurement report
Fix pchan value used for uplink measurement decisions for dynamic channels in
TCH mode.

Fixes this error log message flooding the osmo-bts log when a dyn ts is serving
a voice call:

  <0004> ../../../src/common/measurement.c:104 (bts=0,trx=0,ts=3,ss=0) no space for uplink measurement

Change-Id: Id19316701fd8de6f295eeae0272eea0c315ab1b7
2017-01-06 10:32:19 +00:00
Max f9778b2a26 DTX AMR HR: fix inhibition
* Unlike in AMR FR, in AMR HR incoming ONSET have to be treated
  differently depending on whether we've recently sent SID UPDATE or
  EMPTY frame. Split ST_SID_U FSM state into 2 states to accommodate for
  that and make sure that additional states specific to AMR HR are not
  used for AMR FR.

* Avoid sending E_VOICE and E_SID_U in corresponding states
  as those do not initiate FSM state transitions anyway. This decrease
  extra load from FSM signalling which otherwise would be triggered on
  per-frame basis.

* Introduce separate signal for SID First P1 -> P2 transition to avoid
  confusion with E_COMPL and E_SID_U initiated transitions from P1
  state.

* Don't init DTX FSM for SDCCH channels.

Change-Id: I229ba39a38a223fada4881fc9aca35d3639371f8
Related: OS#1801
2017-01-04 11:25:17 +01:00
Max c2ecca6b04 Integrate Debian packaging changes
debian/control:
    * restructure to make it easier to incorporate further changes
    * update package descriptions
    * update project URL

debian/rules:
    * use proper hardening syntax
    * restructure to make it easier to incorporate further changes
    * remove useless comment
    * add cleanup and test overrides

debian/compat: update compatibility version

Change-Id: Ibf62448eee1df914d21834f5b54831e3f642b79c
Related: OS#1694
2016-12-22 15:11:05 +01:00
Ruben Undheim 86d7843712 Fix some spelling errors
Change-Id: I5b57102f961f8fd7fb0689ceeaa37dd021535b17
2016-12-22 14:04:22 +00:00
Jean-Francois Dionne 304420ca42 DTX: don't always perform AMR HR specific check
Disable check specific to AMR HR if not DTX is enabled.

Change-Id: I8af1daffbd7e59fef6e671dbd9b820497f82d354
Fixes: OS#1892
2016-12-22 12:55:30 +01:00
Max fbe655f320 Optionally use adaptive RTP jitter buffering
* add vty option to manually enable adaptive RTP jitter
  buffering (disabled by default) on per-bts level
* use this setting on per-lchan level when setting jitter parameters via
  vty at runtime
* check and log result of osmo_rtp_socket_set_param()
* note: older libosmo-abis will ignore this setting which will be
  properly detected via return value
* if jitter buffer is disabled by configuring "rtp jitter-buffer 0" than
  adaptive buffering is disabled as well but it will be used if jitter
  buffer is set to different value for a givel lchan via vty

Change-Id: I489f3c419039f40b57c2ef0641c176478b8d3566
2016-12-16 14:04:50 +01:00
Max fed8ce3c5a DTX: fix TS adjustment for ONSET
Previously timestamp was always adjusted according to FN difference. In
case of ONSET event this causes unnecessary TS gap with subsequent
speech packet. Fix this by checking Marker bit before performing
adjustment.

Change-Id: I9bf4b45aa990dd4014334dd846f43f793366056c
Related: OS#1801
2016-12-15 19:57:04 +00:00
Max 2c95ae6a09 osmo-bts-trx: fix lchan deactivation
Use chan_nr for deactivating lchan instead of lchan->nr: chan_nr is the
RSL Channel Number IE value, a bitfield aggregation of lchan type
bits (cbits) and lchan number (lowest three bits). The error was
introduced in 36153239bf.

Change-Id: I6dd7060422ab9d18743c1ff2ab419e3e7299d74d
2016-12-12 12:36:28 +01:00
Max a1fa955212 Save RTP metadata in Control Buffer
Having RTP metadata is useful for debugging - save Sequence Number and
Timestamp next to Marker bit from RTP header.

Change-Id: I359b3bcb74fbfc071547fe2f9d837829374fe997
2016-12-09 11:54:38 +00:00
Max 55a7b07417 DTX: add explicit check if DTX enabled
Check explicitly if DTX is enabled for AMR before checking if SID frame
repetition is optional.

Change-Id: I660688d56505798cade1495c30338fd6806a3259
Related: OS#1801
2016-12-08 14:44:02 +01:00
Max 960dd993cd TRX: prevent segfault upon phy init
Previously if multiply phy instances were configured but not used
osmo-bts-trx would segfault. Terminate with clear error message instead
so user can correct configuration. Example configuration which caused
problem:
...
phy 0
 instance 0
 instance 1
...
 trx 0
  phy 0 instance 0

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

Change-Id: Id979506731ea92401458f1060e87aeb690901539
2016-12-05 18:55:49 +00:00
Neels Hofmeyr 20363d165e bursts test: test_pdtch: pre-init result mem
Fixes: CID#57943
Change-Id: I4547f47c4150759d5c4ab790e34e91b784b03b39
2016-12-02 12:10:03 +00:00
Max 4a85828462 Fix AGCH/PCH proportional allocation
Do not assume that 1 == BS_AG_BLKS_RES but take that information from
SI3. Note: due to current implementation quirks we activate channels
before SI3 obtained, than we deactivate channels upon receiving SI3 and
activate them again. This might not be necessary once we migrate to
proper OML state machines.

This affects lc15 and sysmo hw.

Change-Id: I11377b12680ac3b2f77f80e742b6f0af63fc9c1e
Related: OS#1575
2016-12-01 15:25:26 +00:00
Neels Hofmeyr b58aa60d78 cosmetic: vty prompts: add space after '#'
Typically, our VTY prompts have space after the '#', but some of the osmo-bts
VTY prompts don't:

  OsmoBTS# configure terminal
  OsmoBTS(config)# bts 0
  OsmoBTS(bts)#gsmtap-sapi ccch

Add spaces after the '#' to yield e.g.

  OsmoBTS(bts)# gsmtap-sapi ccch

Change-Id: If0591a359e77f01abb76c4113181af7a7733ddd4
2016-12-01 15:21:52 +00:00
Max 36153239bf Remove duplicated code
Remove lchan deactivation related code duplication to facilitate future
use for dynamic CCCH re-activation.

Change-Id: Id0d3b19dbfaa16d1734321a07a6eb0355bfd77c9
2016-12-01 15:20:42 +00:00
Max aabeb2eae4 DTX DL AMR: rewrite FSM recursion
Add explicit state for recursion (sending the different payload data in
response to the RTS request for same FN) and corresponding
transition. Remove ST_FACCH_V as with new explicit recursion handling it
becomes unreacheable. This makes it easier to maintain
preemption (interruption of current procedure due to FACCH or
Inhibition). This also reduces the number of possible transitions out of
each state thus reducing graph's cyclomatic complexity.

Change-Id: If39b68083d23a4a35f468a5d75f54eb733ebfd14
2016-12-01 14:49:43 +00:00
Alexander Chemeris f4b238f91e trx: Add "maxdlynb" VTY command to control max TA for Normal Bursts.
Originally `maxdly` command in osmo-trx was contrlling max TA for Normal Bursts.
This was not a proper behaviour, because it was used to "control maximum
distance a handset can attach from" which is controlled by Access Bursts max TA.
Osmo-trx was corrected to apply `maxdly` to Access Bursts and a new command was
introduced to contrl max TA for Normal Bursts - `maxdlynb`. This patch adds
support for this configuration command into osmo-bts-trx.

If you wonder why would you need that - some test equipment (namely R&S CMD57)
has really bad timing sync and can generate signal a few symbols off. That
prevents osmo-trx from properly receiving otherwise perfectly good bursts
generated by CMD57. This configuration is a solution for this.

Change-Id: Ib5d255299668ac1ef9f0ce95e016f55ba3c82277
2016-12-01 14:49:15 +00:00
Neels Hofmeyr 103ddc7155 jenkins: add jenkins_bts_model.sh
Change-Id: Ie7c32e68f789414fdf3c407c0da06cbf983f751a
2016-11-30 04:25:42 +01:00
Neels Hofmeyr 704fba5dc2 add jenkins_oct_and_bts_trx.sh
Change-Id: Ib656d4592f5210e2c180f511a1c955d14397bd03
2016-11-30 03:01:30 +01:00
Neels Hofmeyr dd8a4a85e4 add jenkins_bts_trx.sh
Change-Id: Ie27ffb72140cb37e6a05bffd90551197f1e9b5fc
2016-11-30 02:46:43 +01:00
Neels Hofmeyr 6f4ce14ed7 osmo-bts-trx: remove obsolete include of netif/rtp.h
Change-Id: Idf364fd7d69446a7a996062f71d701d9c6cca84c
2016-11-29 22:41:59 +01:00
Philipp Maier 8ea93a8a7d octphy: multi-trx support: fix AC_CHECK order
The header file octphy/octvc1/gsm/octvc1_gsm_default.h is not
visible to the configure script when the octphy header files
are referenced via --with-octsdr-2g instead having them
installed in /usr/local/include. This results in a failed
AC_CHECK_MEMBER check for tOCTVC1_GSM_TRX_CONFIG.usCentreArfcn,
even if header files with multi-trx support are used.

The configure.ac script manipulates the CPPFLAGS in order to
make the octphy include files visible to AC_CHECK_ and restores
the original CPPFLAGS when done. This is required when
--with-octsdr-2g is used. AC_CHECK_MEMBER is executed
before the CPPFLAGS are manipulated. This causes no issues
if the headers are properly installed to /usr/local/include,
but does not work when --with-octsdr-2g is used.

This commit moves the AC_CHECK_MEMBER command into the section
where the manipulated CPPFLAGS are valid in order to fix the
problem described above

See also commit: f5494e84e8

Change-Id: I7bdfa4449cd6061c395cce315b372c2833520e37
2016-11-27 18:28:24 +00:00
Harald Welte ae5405e2a4 vty: Ensure to not use negative (error) sapi value
Change-Id: I282311de8514c1cc0a1b716e97e90ddf48863bb4
Fixes: Coverity CID 57617
Fixes: Coverity CID 57618
2016-11-25 23:50:46 +01:00
Neels Hofmeyr be671bc61f cosmetic: tweak README
I noticed that the README is prominently shown on github, so it makes sense
to get rid of the worst typos and misinformation there.

Change-Id: I60defef6224a78bb84d7d0b57bc8da17ad7877bb
2016-11-23 00:05:13 +01:00
Alexander Chemeris f7b559f960 vty: Add commands to manually activate/deactivate a channel.
This is the easiest way I found to make BTS level loopback to work.
Another way to implement this is to have BSC/NITB to send the OML command, but
it's a longer path with no clear benefits.

Note, that the current code hardcodes the channel to be TCH/F with v1 speech,
which is what we need for the basic BER testing. We may want to extend this
later to support more channel types.

Change-Id: Ia2734afeff023e5b3d6b934c7e8b1ed95a071b72
2016-11-16 16:38:51 +00:00
Alexander Chemeris b2fbdd023b l1sap: Fix use-after-free in loopback mode.
By default l1sap_tch_ind() returns 0 which signals to its caller that message
has been processed and can be freed. In case of loopback we're forwarding
the message to dl_tch_queue who will free it later.  Returning 1 from
l1sap_tch_ind() prevents caller from freeing message.

Change-Id: I1e065075baa51c88fa717f132e1f0a83df68be02
2016-11-14 17:40:34 -08:00
Max 66325aee71 Replace link_id constant with define
Instead of using constant for link_id directly, use shared define value.

Change-Id: Ibf3d439d8893bd994ba089796175b6c635db2cf8
2016-11-11 15:52:49 +01:00
Max bdf10eb705 Remove duplicated code
Having duplicated code to fill in fn & tn values makes it harder to read
and modify static gsmtap_p* functions. Fix this by removing the
duplication and moving the common code one level up.

Change-Id: I0e67bf7423424cc11435bc0a5a1110297eeee383
2016-11-11 12:22:11 +01:00
Neels Hofmeyr c43352dbc4 fix 'osmo-bts-* --version' segfault
Call vty_init() before handle_options() to make sure the host.app_info is
populated before --version potentially tries to print it.

Change-Id: Ic87b5498b57b2f0f876171a15e769b74c28348c1
2016-11-09 15:44:30 +01:00